在settings.xml中配置鉴权账号,否则上传将报401鉴权错误
<server>
<id>deployment</id>
<username>deployment</username>
<password>deployment账号的密码</password>
</server>
二、命令
mvn deploy:deploy-file -DgroupId=groupId -DartifactId=artifactId -Dversion=version -Dfile=本地jar包路径 -DrepositoryId=releases/snapshots -Durl=仓库地址
举例:上传jmxri-1.2.1.jar,本地存放在D盘
mvn deploy:deploy-file -DgroupId=com.aspose.pdf -DartifactId=aspose-pdf -Dversion=11.8.0 -Dpackaging=jar -Dfile=D:\file\pdf-11.8.0.jar -Durl=http://192.168.2.45:9000/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty