1、maven插件的E:\apache-maven-3.3.3\conf\settings.xml查看私库登录权限的id
<server>
<id>deploymentRepo</id>
<username>admin</username>
<password>123456</password>
</server>
私库设置
<mirror>
<id>deploymentRepo</id>
<name>aaa</name>
<url>http://172.16.10.41/repository/maven-public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
id是deploymentRepo
2、编写maven命令
mvn deploy:deploy-file -Dfile=C:\\Users\\liu\\Desktop\\hasp-srm-api.jar -DgroupId=org.hasp -DartifactId=hasp-srm-api -Dversion=1.0.0 -Durl=http://172.16.10.41/repository/maven-releases/ -Dpackaging=jar -DrepositoryId=deploymentRepo
-Dfile:文件路径
-DgroupId:groupId
-DartifactId:artifactId
-Dversion:version
-Durl:要提交到私库的url
-Dpackaging:jar
-DrepositoryId:仓库id号,就是settings.xml中给私库设置的id号