Maven打包上传到私服
在Idea pom.xml中使用distributionManagement
1.pom.xml文件添加distributionManagement节点
nexus-releases Release repository http://192.168.1.xxx:8081/repository/yang/
一般来说,分发构件到远程仓库需要认证,如果你没有配置任何认证信息,你往往会得到401错误。这个时候,如下在settings.xml中配置认证信息:
< repository >节点下的< id >对应setting.xml文件中的server的id
需要注意的是,settings.xml中server元素下id的值必须与POM中repository或snapshotRepository下id的值完全一致。将认证信息放到settings下而非POM中,是因为POM往往是它人可见的,而settings.xml是本地的。
mvn deploy 用来将项目生成的构件分发到远程Maven仓库。
原文:https://www.cnblogs.com/bj-xiaodao/p/14865609.html