简体   繁体   English

从声纳运行器2.3切换到2.4会导致分析错误

[英]switching from sonar-runner 2.3 to 2.4 results in error on analysis

I have a multi module project set up for sonar analysis using way #2 from Analyzing with SonarQube Runner . 我有一个使用SonarQube Runner与“分析”中的方法2进行声纳分析的多模块项目。

The only difference is that I dont use a global sonar-project.properties file. 唯一的区别是,我不使用全局的sonar-project.properties文件。 The global properties are defined in jenkins in the sonar runner build step. 全局属性在jenkins声纳运行器构建步骤中定义。

This works perfectly fine with Sonar Runner 2.3. 这与Sonar Runner 2.3完美配合。 As soon as I switch from 2.3 to Sonar Runner 2.4 this fails with the error that the mandatory sonar.sources property is not defined. 一旦我从2.3切换到Sonar Runner 2.4,它就会失败,并显示错误消息,即未定义必需的sonar.sources属性。

I have tried setting it in my global properties to sonar.sources=src but then sonar can't analyze a module that doesn't use src as source folder. 我尝试在全局属性中将其设置为sonar.sources = src,但是sonar无法分析不使用src作为源文件夹的模块。

It looks to me like Sonar Runner 2.4 doesn't use the module's sonar-project properties anymore. 在我看来,Sonar Runner 2.4不再使用该模块的声纳项目属性。

Or is there a way to tell Sonar Runner 2.4 to use the module's sonar-project.properties file? 还是有办法告诉Sonar Runner 2.4使用该模块的sonar-project.properties文件?

The two supported layout when using SQ Runner are: 使用SQ Runner时,两个受支持的布局是:

  • put all properties of all modules in root sonar-project.properties file 将所有模块的所有属性放在根sonar-project.properties文件中
  • put each module properties in its own sonar-project.properties in addition to the root sonar-project.properties 除了根目录sonar-project.properties之外, sonar-project.properties每个模块的属性放在其自己的sonar-project.properties

It is also possible to add properties via command line (this is what you do when you define properties in SQ Runner build step). 也可以通过命令行添加属性(这是在SQ Runner构建步骤中定义属性时要做的事情)。

Your attempt to not have a root sonar-project.properties but having individual sonar-project.properties files in sub modules was not identified as a supported use case. 您尝试不具有根sonar-project.properties但在子模块中具有单个sonar-project.properties文件的尝试未被标识为受支持的用例。 So I'm not very surprised it is no more supported (it was likely a side effect). 所以我并不感到惊讶,它不再受到支持(这可能是副作用)。

See http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Runner#AnalyzingwithSonarQubeRunner-Multi-moduleProject 参见http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Runner#AnalyzingwithSonarQubeRunner-Multi-moduleProject

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

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