maven私服nexus3上传jar包报错问题(解决办法)

1.maven私服nexus3上传jar包报错如下:

C:\Users\zheng>mvn deploy:deploy-file -DgroupId=org.jeewx -DartifactId=jeewx-api -Dversion=1.1-SNAPSHOT -Dpackaging=jar -Dfile=E:\EclipseProject\SmartCityService\doc\org\jeewx\jeewx-api\1.1-SNAPSHOT\jeewx-api-1.1-SNAPSHOT.jar -Durl=http://192.168.1.112:8081/repository/maven-releases/ -DrepositoryId=nexus
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ standalone-pom ---
Downloading: http://192.168.1.112:8081/repository/maven-releases/org/jeewx/jeewx-api/1.1SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata org.jeewx:jeewx-api:1.1SNAPSHOT/maven-metadata.xml from/to nexus (http://192.168.1.112:8081/repository/maven-releases/): Failed to transfer file: http://192.168.1.112:8081/repository/maven-releases/org/jeewx/jeewx-api/1.1SNAPSHOT/maven-metadata.xml. Return code is: 400 , ReasonPhrase:Repository version policy: RELEASE does not allow metadata in path: org/jeewx/jeewx-api/1.1SNAPSHOT/maven-metadata.xml.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.165 s
[INFO] Finished at: 2017-03-27T14:57:42+08:00
[INFO] Final Memory: 11M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to retrieve remote metadata org.jeewx:jeewx-api:1.1SNAPSHOT/maven-metadata.xml: Could not transfer metadata org.jeewx:jeewx-api:1.1SNAPSHOT/maven-metadata.xml from/to nexus (http://192.168.1.112:8081/repository/maven-releases/): Failed to transfer file: http://192.168.1.112:8081/repository/maven-releases/org/jeewx/jeewx-api/1.1SNAPSHOT/maven-metadata.xml. Return code is: 400 , ReasonPhrase:Repository version policy: RELEASE does not allow metadata in path: org/jeewx/jeewx-api/1.1SNAPSHOT/maven-metadata.xml. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

2.解决办法

我试验后发现是自己上传的jar包的-Dversion=1.1-SNAPSHOT和jeewx-api-1.1-SNAPSHOT.jar包的后面同名所致,所以修改版本号就可以解决的,一般建议版本号用数字命名不建议用英文;


如果您喜欢这篇文章就请关注我的博客和朋友一起分享吧!
关注我: ☛ http://blog.csdn.net/yougoule

转载于:https://www.cnblogs.com/pengtdy/p/8306242.html

你可能感兴趣的:(maven私服nexus3上传jar包报错问题(解决办法))