[英]Deploy Maven artifacts on Sonatype Nexus repository hosted on Linux
I am new to Sonatype Nexus and Maven and trying examples as given in Maven by Example .我是Sonatype Nexus和 Maven 的新手,并尝试了Maven 中给出的示例 Example 。 I have a problem deploying artifacts generated by Maven to Nexus running on Linux.我在将 Maven 生成的工件部署到在 Linux 上运行的 Nexus 时遇到问题。 If my pom.xml
has 'localhost:8081' as the repository, the deployment is a success.如果我的pom.xml
有 'localhost:8081' 作为存储库,则部署成功。 If I replace localhost with an IP address (10.193.4.5:8081) deployment fails with 'Access denied' error.如果我用 IP 地址 (10.193.4.5:8081) 替换 localhost,则部署失败并出现“拒绝访问”错误。 Details below.详情如下。
Error:
Downloading: h ttp://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata org.sonatype.mavenbook.simple:parent:0.8-SNAPSHOT/maven-metadata.xml from/to testing
(http://10.193.4.5:8081/nexus/content/repositories/snapshots): Access denied to: http://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml
org.sonatype.aether.transfer.MetadataTransferException:
Could not transfer metadata org.sonatype.mavenbook.simple:parent:0.8-SNAPSHOT/maven-metadata.xml from/to testing (http://10.193.4.5:8081/nexus/content/repositories/snapshots): Access denied to:
http://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml
My configuration details are as follows.我的配置细节如下。
settings.xml
snapshots deployment deployment settings.xml
快照部署部署pom.xml
testing Internal Releases http://10.193.4.5:8081/nexus/content/repositories/snapshots</url>--> http://localhost:8081/nexus/content/repositories/snapshots pom.xml
testing Internal Releases http://10.193.4.5:8081/nexus/content/repositories/snapshots</url>--> http://localhost:8081/nexus/content/repositories/snapshotsI guess this is related to a permission problem on Linux, and I am not able to debug.我猜这与 Linux 上的权限问题有关,我无法调试。
Your problem is most likely related to networking and not to the Nexus setup.您的问题很可能与网络有关,而不是与 Nexus 设置有关。 Try尝试
nc -vz 10.193.4.5 8081
at the console to see if you can route packets to that address.在控制台查看是否可以将数据包路由到该地址。 To make it work with the IP, you'll probably need to add an /etc/hosts entry.要使其与 IP 一起使用,您可能需要添加 /etc/hosts 条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.