Posted by Sunfy on
2020-12-17
Words 1.6k and
Reading Time 8 Minutes
Viewed Times
Viewed Times
Visitors In Total
我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: … Return code is: 4XX, ReasonPhrase: … 类似这样的错误,那么这些错误是怎么产生,又如何解决呢?我在此将自己在部署过程中遇到的错误整理汇总一下,供大家参阅,希望对大家有所帮助。
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.135 s [INFO] Finished at: 2016-02-18T10:23:58+08:00 [INFO] Final Memory: 19M/174M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project xeger: Failed to deploy artifacts: Could not transfer artifact nl.flotsam:xeger:jar:1.0.2 from/to nexus-releases (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/nl/flotsam/xeger/1.0.2/xeger-1.0.2.jar. Return code is: 400, ReasonPhrase: Bad Request. -> [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
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.215 s [INFO] Finished at: 2016-02-18T10:50:56+08:00 [INFO] Final Memory: 19M/175M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project xeger: Failed to deploy artifacts: Could not transfer artifact nl.flotsam:xeger:jar:1.0.2 from/to nexus-releases (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/nl/flotsam/xeger/1.0.2/xeger-1.0.2.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [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
Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
具体提示信息如下所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.969 s [INFO] Finished at: 2016-02-18T10:47:22+08:00 [INFO] Final Memory: 18M/177M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project xeger: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [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
Copyright 2021 sunfy.top ALL Rights Reserved