1 pom.xml配置
<properties>
<!--仓库地址 -->
<repository.url>http://10.3.3.12:8081/repository/maven-public/</repository.url>
<releases.url>http://10.3.3.12:8081/repository/maven-releases/</releases.url>
<snapshot.url>http://10.3.3.12:8081/repository/maven-snapshots/</snapshot.url>
</properties>
<distributionManagement>
<repository>
<id>ncamcmaven-releases</id>
<name>releases</name>
<url>${releases.url}</url>
</repository>
<snapshotRepository>
<id>ncamcmaven-snapshots</id>
<name>snapshots</name>
<url>${snapshot.url}</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>maven private</id>
<name>internal repository for private</name>
<url>${repository.url}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>${repository.url}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
2 settings.xml配置
<servers>
<server>
<id>ncamcmaven-public</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>ncamcmaven-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>ncamcmaven-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>
<id>ncamcmaven-public</id>
<name>ncamcmaven</name>
<mirrorOf>*</mirrorOf>
<url>http://10.3.3.12:8081/repository/maven-public/</url>
</mirror>
<mirror>
<id>ncamcmaven-snapshots</id>
<name>ncamcmaven</name>
<mirrorOf>*</mirrorOf>
<url>http://10.3.3.12:8081/repository/maven-releases/</url>
</mirror>
<mirror>
<id>ncamcmaven-releases</id>
<name>ncamcmaven</name>
<mirrorOf>*</mirrorOf>
<url>http://10.3.3.12:8081/repository/maven-snapshots/</url>
</mirror>
<!-- 阿里的配置 -->
<mirror>
<id>alimaven</id>
<name>alimaven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>