为什么jenkins中的声纳插件要重新构建所有内容?

发布于 2024-12-15 21:53:09 字数 137 浏览 5 评论 0原文

我在构建机器上安装了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵性 2024-12-22 21:53:09

声纳分析是通过 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文