1、项目私库服务器配置
settting 文件里面的配置
<profiles>
<profile>
<id>nexusProfiles</id>
<repositories>
<repository>
<id>nexus</id>
<name>nexus Repository</name>
<release>
<enabled>true</enabled> <!-- 是否可以下载release的包 true为空,false为不可以,默认为false-->
</release>
<snapshots>
<enabled>true</enabled> <!-- 是否下载snapshots的包 -->
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<!-- 只有激活之后才会生效 -->
<activeProfiles>
<activeProfile>nexusProfiles</activeProfile>
</activeProfiles>
2、maven的默认中央仓库配置
apache-maven-3.2.3\lib\
maven-model-builder-3.2.3.jar 包里面的 pom-4.0.0.xml文件里,如图
3、maven中央工厂只能有私有仓库访问,需要配置镜像 mirror
<!-- 工厂镜像,只要mirrorOf 的工厂要访问,都会自动来找镜像,
如果镜像无法访问,就不会再去中央工厂访问
-->
<mirror>
<id>nexusMirror</id>
<mirrorOf>nexus,central</mirrorOf> <!-- central 代表中央工厂
https://repo.maven.apache.org/maven2/ , * 表示所有的工厂-->
<name>Human Readable Name for this Mirror.</name>
</mirror>
配置镜像之后,可以不使用
<!-- 只有激活之后才会生效 -->
<activeProfiles>
<activeProfile>nexusProfiles</activeProfile>
</activeProfiles>