为什么jenkins中的声纳插件要重新构建所有内容?
我在构建机器上安装了 Jenkins,并在 Jenkins 配置中选中了在我的基于 Maven 的项目上运行声纳分析的框。它有效,但如果我查看日志,我的整个项目都会构建两次。一次来自 Maven,一次用于声纳(仍然使用 Maven)。知道我在这里做错了什么吗?
I installed Jenkins on my build machine and in the Jenkins config checked the box to run sonar analysis on my maven based project. It works but if I look at the log my entire project is built twice. Once from maven and once for sonar (still using maven). Any idea what I am doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
声纳分析是通过 Maven 插件执行的。因此,每当您开始声纳分析时,maven 都会运行声纳阶段之前的所有阶段,这意味着它还将运行编译和测试阶段。
这意味着,如果您想做声纳分析,您可以在 Jenkins 中创建自由式作业,不配置构建步骤,只激活声纳按钮。这应该可行,并且应该只构建一次代码项目。
Sonar analysis is performed through a maven plugin. So, whenever you start a sonar analysis, maven will run through all phases that come before the sonar phase, meaning that it will also run the compile and the test phase.
This means, if you want to do a Sonar analysis, you can make a Free-Style Job in Jenkins, configure no Build Step, and only activate the Sonar button. That should work, and should only build your code project once.