使用nexus主机名而不是ip地址时,使用502代码将Maven部署到Nexus失败。 当我使用ip进行部署时,它被取代了。
Maven distributionManagement:
<distributionManagement>
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://dev11:8082/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Internal snapshots</name>
<url>http://dev11:8082/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
错误信息:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project myapplication-api: Failed to retrieve remote metadata com.mycompany.mygroup:myapplication-api:1.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.mycompany.mygroup:myapplication-api:1.0-SNAPSHOT/maven-metadata.xml from/to snapshots (http://dev11:8082/nexus/content/repositories/snapshots/): Failed to transfer file: http://dev11:8082/nexus/content/repositories/snapshots/com/mycompany/mygroup/myapplication-api/1.0-SNAPSHOT/maven-metadata.xml. Return code is: 502 , ReasonPhrase:No data received from server or forwarder. -> [Help 1]
答案 0 :(得分:0)
我知道
我添加了代理但未排除主机名
修复了添加
后的问题<proxy>
...
<nonProxyHosts>dev11</nonProxyHosts>