简体   繁体   English

Sonarqube - 如何为 Kotlin 项目启用许可证检查器?

[英]Sonarqube - how to enable license-checker for Kotlin projects?

I'm setting up a Sonarqube Developer Edition server and am trying to use the license-checker plugin I got from:我正在设置 Sonarqube 开发人员版服务器,并尝试使用我从以下获得的许可证检查器插件:

https://github.com/porscheinformatik/sonarqube-licensecheck https://github.com/porscheinformatik/sonarqube-licensecheck

The plugin's jar is deployed to the correct directory and I have created a new Sonar way (license) Java profile that inherits the profile Sonar way (Built-in) .插件的 jar 部署到正确的目录,我创建了一个新的Sonar way (license) Java profile,它继承了配置文件Sonar way (Built-in) In the new profile, I added the "License is not allowed" and "Dependency has unknown license" rules the plugin requires to work.在新的配置文件中,我添加了插件工作所需的"License is not allowed""Dependency has unknown license"规则。 I tested with a Java project and it works flawlessly.我用一个 Java 项目进行了测试,它运行良好。

I tried the same approach for the Kotlin profile Sonar way (license) I created and that inherits the Sonar way (Built-in) profile.我为我创建的 Kotlin 配置文件Sonar way (license)尝试了相同的方法,它继承了Sonar way (Built-in)配置文件。 But these rules are not available to Kotlin and, thus, the License check plugin does not run when I attempt to analyze a Kotlin project.但是这些规则不适用于 Kotlin,因此,当我尝试分析 Kotlin 项目时,许可证检查插件不会运行。

This seems to be a Java-specific plugin, but I might be mistaken.这似乎是一个特定于 Java 的插件,但我可能弄错了。 Is there a way to get this working I am not realizing?有没有办法让我没有意识到这个工作?

Long story short, the plugin does not support my scenario.长话短说,该插件不支持我的方案。

Long story, my question was not clear enough and I failed to put some information as I was learning about this build myself.长话短说,我的问题还不够清楚,我在自己学习这个构建时未能提供一些信息。 The project is in Kotlin and uses gradle to handle dependencies.该项目在 Kotlin 中,并使用 gradle 来处理依赖项。 The plugin only supports maven and NPM builds.该插件仅支持 maven 和 NPM 构建。 So, for my to achieve the desired result, I would need to extend the plugin to handle the build.gradle.kts file.因此,为了达到预期的效果,我需要扩展插件来处理build.gradle.kts文件。 This task is a very big question mark in itself, so I will be looking at another alternative for the time being.这项任务本身就是一个很大的问号,所以我暂时会寻找另一种选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM