idea发布nexus的私有服务
发布时报错:
Return code is: 400 , ReasonPhrase:Repository version policy: RELEASE does not allow metadata in pat]
报错是需要把Nexus 上传打开,默认情况下部署构件到Releases仓库中有时也会出现400错误,这个原因就像上面提到的那样,Nexus中 Releases仓库默认的Deployment Policy是“Disable Redeploy”,
所以无论你在settings.xml文件中将server的username设置为deployment还是使用admin都是无 法部署的,就会出现这个400错误
修改后又出现了Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout url 这个错误
将 distributionManagement改为
<distributionManagement> <repository> <id>hjc</id> <name>hjc</name> <url>http://192.168.136.129:8081/repository/hjc/</url> <uniqueVersion>true</uniqueVersion> </repository> <!--<snapshotRepository>--> <!--<id>nexus</id>--> <!--<name>snapshots</name>--> <!--<url>http://192.168.136.129:8081/repository/hjc/</url>--> <!--</snapshotRepository>--> </distributionManagement>
发布成功: