【发布时间】:2011-09-04 19:09:55
【问题描述】:
我们正在使用 maven 2.2.1 并且对事情的进展非常满意。 最近我们开始像这样使用依赖版本的范围:
<dependency>
<!-- com.google.inject.Guice -->
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>[3,4)</version>
</dependency>
但现在我面临一个问题,即 maven 在每次构建时检查每个此类依赖项的新版本,这使得构建非常缓慢:
[INFO] artifact com.google.inject:guice: checking for updates from internal
[INFO] artifact com.google.inject:guice: checking for updates from central
这是我的存储库声明的样子:
<repositories>
<repository>
<id>internal</id>
<url>http://internal.repo.local/nexus/content/repositories/releases</url>
</repository>
</repositories>
据我所知,我已经检查了存储库配置,查看了 <repository/> 部分和父 POM 继承的默认值。
我已经尝试过更改updatePolicy,但没有成功。看起来所有策略都仅适用于 SNAPSHOT 管理,并且在版本检查中被忽略。
我找到了-o 命令行选项的解决方法,但是...我想至少有时检查外部版本,并且每天更新本地存储库的基于cron 的maven 调度的想法不会sound for 作为一个合适的解决方案。
【问题讨论】:
-
这是不使用版本范围的原因之一。它们使构建不可重现。
-
我知道这将使我的构建不可复制,我愿意忍受它。 =)
标签: maven-2