本地settings文件
<servers>
<server>
<id>snapshots</id>
<username>*****</username>
<password>*****</password>
</server>
</servers>
修改pom文件
<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<!-- 项目私服地址 -->
<url>http://mvnrepo/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
mvn deploy
mvn deploy
直接命令上传
mvn deploy:deploy-file -DgroupId=com.xx.xx -DartifactId=xx -Dversion=1.0.0 -Dpackaging=jar -Dclassifier=sources -Dfile=xx-sources.jar -Durl=仓库地址 -DrepositoryId=仓库名