1、settings.xml
(向私服上传资源需要)
<!-- Snapshot包的管理/Releases包的管理/第三方包管理-->
<server>
<id>lutao-maven-nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
2、pom.xml
(配置repository:私服库代理*仓库需要)
(配置snapshotRepository、repository:SNAPSHOT包上专需要、RELEASES包上传需要)
<repositories>
<!-- 代理*仓库 -->
<repository>
<id>maven-central</id>
<name>maven-central</name>
<url>http://192.168.0.86:8081/repository/maven-central/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories> <distributionManagement>
<!-- Snapshot包的管理 -->
<snapshotRepository>
<id>lutao-maven-nexus</id>
<name>Nexus Snapshot</name>
<url>http://192.168.0.86:8081/repository/maven-snapshots/</url>
</snapshotRepository>
<!-- Releases包的管理 -->
<repository>
<id>lutao-maven-nexus</id>
<name>Nexus releases</name>
<url>http://192.168.0.86:8081/repository/maven-releases/</url>
</repository>
</distributionManagement>
3、第三方资源上传到私服库
mvn deploy:deploy-file -DgroupId=taobao-sdk -DartifactId=taobao-sdk-java -Dversion=1.0 -Dpackaging=jar -Dfile=E:\DUANBO\Desktop\taobao-sdk-java-1.0.jar -Durl=http://192.168.0.86:8081/repository/maven-releases/ -DrepositoryId=lutao-maven-nexus mvn deploy:deploy-file -DgroupId=com.jd.trip -DartifactId=trip-soa-common -Dversion=0.0.-SNAPSHOT -Dpackaging=jar -Dfile=E:\DUANBO\Desktop\trip-soa-common-0.0.-SNAPSHOT.jar -Durl=http://192.168.0.86:8081/repository/maven-snapshots/ -DrepositoryId=lutao-maven-nexus