警告开发人员有关过时的依赖项
Maven、Hudson 或 Sonar 中是否有一种方法可以在构建中包含某些过时的工件时发出警告。
例如,考虑拥有许多内部业务罐子。这些罐子的某些版本可能会经历生命周期结束阶段。在此期间,如果发生的任何构建都会发出某种警告并引导用户查看有关该问题的一些文档,那就太好了。
需要明确的是,构建不应该失败。此外,我们只想将此逻辑应用于特定的工件集,而不是所有工件。
Is there a way in Maven, Hudson, or Sonar to warn on the inclusion of certain out of date artifacts in a build.
For example, consider having a number of internal business jars. Some versions of these jars can go through an end-of-life phase. During this time, it would be nice if any builds that occurred would issue some sort warning and direct the user to some documentation about the issue.
To be clear, builds shouldn't fail. Also, we only want to apply this logic to a certain set of artifacts, not everything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Maven 依赖项插件,您可以运行此命令。
这将显示存储库中具有可用更新版本的所有工件的列表。只需让开发人员经常运行并相应更新即可。
Using the maven dependency plugin you can run this
This will display a list of all artifacts that have newer versions available in the repository. Just have the devs run that every so often and update accordingly.
您可以尝试使用 enforcer 插件 来指定不再存在的依赖项允许。
插件的目标是强制执行规则(从而使构建失败)或打印违规报告。
更新
我使用 Sonar 中的依赖项报告来查找过时库的跨项目使用情况。
我知道您也在使用声纳,但为了以防万一,这里有一个示例:
(该信息来自Sonar分析的每个项目的Maven POM)。
我认为你真正想要的东西目前并不存在......一个像标准 Maven 执行器插件一样工作的插件,但在 Sonar 中配置并引发违规!
您为什么不将此作为一个想法发布在 Sonar JIRA 上?
You could try using the enforcer plugin to specify the dependencies which are no longer allowed.
Plugin has goals to either enforce the rules (thereby failing your build) or print a violation report.
Update
I use the dependencies report in Sonar to lookup cross project usage of obsolete libraries.
I know you're also using Sonar, but just in case here's an example:
(This information is coming from the Maven POM of each project analysed by Sonar).
I think what you're really looking for, does not currently exist.... A plugin that works like the standard Maven enforcer plugin, but is configured from and raises violations in Sonar!
Why don't you post this as an idea on the Sonar JIRA?