mvn 命令上传 jar 包到 nexus 私仓

上传到 SNAPSHOT 版仓库

mvn deploy:deploy-file -DgroupId=com.xxx -DartifactId=xxx -Dversion=x.x.0-SNAPSHOT -Dpackaging=jar -Dfile=xxx-x.x.0.jar -Durl=http://localhost:8081/repository/maven-snapshots/ -DrepositoryId=仓库唯一标识

这里需要注意的地方

在上传 jar 包到 SNAPSHOT 版仓库时,版本号必须携带 -SNAPSHOT,否则会提示 400 的问题。

原文地址:https://www.cnblogs.com/gaofangye/p/14367740.html