mvn deploy Return code is: 400

 

原log为:react

Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact org.springframework:spring-web-reactive:jar:5.0.0.BUILD-20161108.121529-1 from/to archiva.internal (http://nexus.d.xiaomi.net/nexus/content/repositories/releases/): Failed to transfer file: http://nexus.d.xiaomi.net/nexus/content/repositories/releases/org/springframework/spring-web-reactive/5.0.0.BUILD-SNAPSHOT/spring-web-reactive-5.0.0.BUILD-20161108.121529-1.jar. Return code is: 400, ReasonPhrase: Bad Request.web

 

使用mvn deploy发布到远程仓库时报错 Return code is: 400spring

可能出现这种的状况,缘由有以下可能:apache

  • 1.nexus的repository分三种类型:Hosted、 Proxy和Virtual,另外还有一个repository group(仓库组)用于对多个仓库进行组合。部署的时候只能部署到Hosted类型的仓库中,若是是其余类型就会出现这个400错误。
  • 2.默认状况下部署构件到Releases仓库中有时也会出现400错误,这个缘由就像上面提到的那样,Nexus中 Releases仓库默认的Deployment Policy是“Disable Redeploy”, 因此不管你在settings.xml文件中将server的username设置为deployment仍是使用admin都是无 法部署的,就会出现这个400错误。
  • 3.Nexus中 Releases仓库Respository PolicySnapshot是“Release” ,Snapshot仓库Respository PolicySnapshot是“Snapshot” 若是设置反了或错了也是没法部署的。
  • 4.若是你Snapshot能够发布,可是releases却发布不了,多是<version>1.0-SNAPSHOT</version>相似这样的,version中包含了-SNAPSHOT,因此release发布不了,也会返回400错误。

    个人问题就是第四种状况致使,找到缘由后,就deploy成功了。maven

相关文章
相关标签/搜索