一、配置setting.xml
1.在maven setting.xml 加入内容
<!--配置可发布用户,两id必须一致 -->
<servers>
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>thirdparty</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>
<!--配置使用本地私服 -->
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>public</id>
<name>Local Public Repository</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>Local Public Repository</name>
<url>http://localhost:8081/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
二、命令行上传jar包并打入本地库
1.将本地jar包上传到nexus命令
mvn deploy:deploy-file -DgroupId=com.acts -DartifactId=alipay-sdk-java -Dversion=1.0.0 -Dpackaging=jar -Dfile=C:\xxx.jar -Durl=http://localhost:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty
2.将本地jar包打入到本地库命令,在pom文件中即可引入mvninstall:install-file-Dfile=C:\xxx.jar-DgroupId=com.acts-DartifactId=alipay-trade-sdk-Dversion=1.0.0-Dpackaging=jar
原文链接:https://www.f2er.com/xml/293882.html