使用主机名而不是 IP 地址时,Maven 部署到 Nexus 失败并显示 502 代码
Maven deploy to Nexus failed with 502 code when using hostname instead of ip address
当使用 Nexus 主机名而不是 IP 地址时,Maven 部署到 Nexus 失败并显示 502 代码。
我用ip部署成功了
Maven 分发管理:
<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]
我知道
我添加了代理但不排除主机名
修复了添加后的问题
<proxy>
...
<nonProxyHosts>dev11</nonProxyHosts>
当使用 Nexus 主机名而不是 IP 地址时,Maven 部署到 Nexus 失败并显示 502 代码。 我用ip部署成功了
Maven 分发管理:
<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]
我知道
我添加了代理但不排除主机名
修复了添加后的问题
<proxy>
...
<nonProxyHosts>dev11</nonProxyHosts>