【发布时间】:2009-08-07 14:34:14
【问题描述】:
我在我的项目中使用 maven,我需要在 non-internet-access 机器上运行构建。
当我测试我的项目构建时,一切正常,但是当我在未来的时刻运行构建时,maven 会尝试更新 mvn-plugins 并且这 sht* 破坏了我的构建。
我的配置文件:settings.xml来自 mvn。
<profile>
<id>blaProfile</id>
<repositories>
<repository>
<id>blaRepo</id>
<url>file://${bla.3rdParty.home}/maven/.m2/repository</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>blaRepo</id>
<url>file://${bla.3rdParty.home}/maven/.m2/repository</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
</profile>
<activeProfiles>
<activeProfile>blaProfile</activeProfile>
</activeProfiles>
我用参数运行了我的 maven:
mvn -npu -bla.3rdParty.home="$(THE_CORRECT_PATH)" package
我看到 maven 尝试更新一些 mvn-plugins 有一段时间了,但是选项:
-npu,--no-plugin-updates Suppress upToDate check for any relevant
应该适用于此更新。
好吧,等待一些帮助!
提前致谢!
更新(1):
我正在看的是我可以使用以下设置:
<usePluginRegistry>true</usePluginRegistry>
在我的 settings.xml 中,我将在 ${user.home}/.m2 中有一个 plugin-registry.xml 我可以配置并强制使用 Maven 插件版本。
但它不工作! :(
【问题讨论】:
-
您找到造成这种奇怪行为的原因了吗?
-
我个人怀疑这个“问题”可能与 Maven 的“插件前缀解析”有关,maven.apache.org/guides/introduction/…。
标签: java maven-2 offline-mode