我在我的项目中使用maven,我需要在非互联网访问机器上运行构建.
当我测试我的项目构建时,一切正常,但是当我在未来的时刻运行构建时,maven会尝试更新mvn-plugins,而这个sh t*正在破坏我的构建.
我的配置文件:来自mvn的settings.xml.
<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>
Run Code Online (Sandbox Code Playgroud)
我用我的maven跑了params:
mvn -npu -bla.3rdParty.home="$(THE_CORRECT_PATH)" package
Run Code Online (Sandbox Code Playgroud)
我看到maven尝试更新一些mvn-plugins一段时间,但选项:
-npu,--no-plugin-updates Suppress upToDate check for any relevant
Run Code Online (Sandbox Code Playgroud)
应该适用于此更新.
那等待一些帮助!
提前致谢!
<usePluginRegistry>true</usePluginRegistry>
Run Code Online (Sandbox Code Playgroud)
在我的settings.xml中,有了这个,我将在$ {user.home} /.m2中有一个plugin-registry.xml,我可以配置并强制使用maven插件版本.
但它不起作用!:(