命令
mvn deploy:deploy-file "-Dmaven.test.skip=true" "-DgroupId=com.bes.appserv-web" "-DartifactId=bes-lite-spring-boot-2.x-starter" "-Dversion=9.5.2.010-SNAPSHOT" "-Dpackaging=jar" "-Dfile=E:\fingard-core\bes-lite服务器\bes-lite-9.5.2-spring-boot-2 2.x\bes-lite-spring-boot-2.x-starter-9.5.2.010-SNAPSHOT.jar" "-DrepositoryId=fingard_rdp_escp_hosted_snapshots" "-Durl=http://xxx.xxx.net:9561/nexus/content/repositories/fingard_rdp_escp_hosted_snapshots/"
参数说明
-DgroupId:jar的groupId
-Dversion:jar版本号
-Dpackaging:jar打包方式 ,pom 或 jar
-Dfile:jar文件路径及文件名
-DrepositoryId:maven 仓库ID ,可登录maven 仓库查看
-Durl:与-DrepositoryId 对应的仓库地址
出现错误:
1、使用Maven命令上传文件到私服出错: but there is no POM in this directory...
原因:参数没有 " 引号,导致命令解析错误
2、Return code is: 400, ReasonPhrase: Bad Request 错误
原因:-DrepositoryId 与 -Durl 不对应 ,或者仓库不存在对应的id