I’d like a maven install:install-file like command I can have new team members run in order to pull down and install the base project locally without having to check the project out from source control and mvn install it.
Maven Dependency Plugin及其dependency:get目标在这里可能会有所帮助,您可以这样做:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \n -Dartifact=groupId:artifactId:version[:packaging] \n -DrepoUrl=http://repository.mycompany.com/
但让我回过头来看看:
However the base exists in one of the repositories defined in the base (…)
除非这真的是你想要的(为中心找不到的东西添加一个存储库),这通常不是人们在企业环境中声明Nexus存储库的方式.
人们通常希望所有请求都通过他们的Nexus存储库并在其中存储工件.存储您需要的所有工件是确保您能够在1年,5年,10年内重复构建的唯一方法.当然,maven人在中央做得很好,但你确定要依靠不受你控制的东西吗?因此,人们通常会在settings.xml中将Nexus声明为所有内容的镜像(请参阅第4.2. Configuring Maven to Use a Single Nexus Group节).
如果您不希望每个用户在其?/ .m2 / settings.xml中添加所需的片段,最好的选择是分发和使用Maven客户端的公司版本,并根据需要使用conf /预配置它. settings.xml文件.
参考
> Nexus用户指南