2015-10-27 57 views
1

我试图在Jenkins版本中获得.NET项目的FxCop分析(调用独立SonarQube分析)。使用Jenkins SonarQube插件进行FxCop分析?

配置是这样的:

  • SonarQube 5.1.2
  • C#4.2
  • 声纳亚军2.4
  • 詹金斯:SonarQube插件2.2.1

和主问题是,当我在SonarQube中启用FxCop规则时,出现错误:

java.lang.IllegalArgumentException: The property "sonar.cs.fxcop.assembly" must be set and the project must have been built to execute FxCop rules. This property can be automatically set by the Analysis Bootstrapper for Visual Studio Projects plugin, see: http://docs.codehaus.org/x/TAA1Dg.If you wish to skip the analysis of not built projects, set the property "sonar.visualstudio.skipIfNotBuilt".

但是,如果我明确地设置sonar.cs.fxcop.assemblysonar-project.properties在集(.dll),我得到了一个分析,以点带面,但该项目有多个我希望进行FxCop分析的程序集。 即使可以将程序集列表设置为参数(是吗?),这不是一个优雅/通用的解决方案,并且模式不是可接受的值。

我明白的MSBuild SonarQube亚军可以解决这个问题(无需设置sonar.cs.fxcop.assembly),但它看起来像它不是对詹金斯插件一个很好的候选人(下SonarQube亚军安装),因为只有声纳运行者允许安装。

有什么办法,我能得到的FxCop使用詹金斯插件和声纳亚军时没有设定sonar.cs.fxcop.assembly性质的工作?

+0

您对问题的描述是公平的,但您可以通过显示您正在使用的代码来改进它。 – jkalden

回答

1

事实上,MSBuild的项目应使用的MSBuild SonarQube亚军,对其中有目前詹金斯没有专门构建步骤尚未进行分析:您可以使用Execute Windows batch command步骤在调用的MSBuild之间执行MSBuild.SonarQube.Runner.exe begin ...MSBuild.SonarQube.Runner.exe end

随着即将发布的Jenkins SonarQube插件版本2.3,将会有两个专门的构建步骤,一个用于MSBuild SonarQube Runner的开始调用,另一个用于结束调用。见https://jira.sonarsource.com/browse/SONARJNKNS-219

你应该使用声纳亚军,也不是Invoke Standalone SonarQube Analysis詹金斯生成步骤(这只是调用声纳亚军)来分析.NET项目:MSBuild的SonarQube亚军是要走的路。

+0

谢谢Dinesh为Jenkins插件增添了一些亮点。 – Stefan

相关问题