nexus maven域名后缀不正确

时间:2012-10-25 21:11:00

标签: maven nexus

架构:

公司nexus在box1:8081上设置
哈德森在box1:8090上设置

上述两个系统都有代理,并且可以成功访问公共互联网(通过Nexus浏览远程功能确认,Hudson能够按预期构建maven项目,填充hudson正在使用的新的.m2 /存储库)

但是 - 当我编辑settings.xml以使用nexus镜像时(根据行上的多个指令,即:here),将我的存储库重命名为repository_old(因此我可以跟踪正在获取的新依赖项)是问题)然后运行一个简单的maven目标,如干净或安装,我得到一个奇怪的情况。

命令终端将输出

Downloading: http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
4 KB   
[WARNING] Checksum validation failed, expected <!DOCTYPE but is f91612c35130352fb87d878ad11e365864726080 for http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
4 KB
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 45ab043cf424aacf8b314b01bdae110516db8d1f for http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom
Downloaded: http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom (4 KB at 1.0 KB/sec)
[WARNING] The POM for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Downloading: http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.jar
4 KB   
[WARNING] Checksum validation failed, expected <!DOCTYPE but is ac40ff8e0340bd60e08433c1440a699049d77126 for http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.jar
4 KB   
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 11b860e6a486fb2e5c1ffcc56d9240139dcfb2f0 for http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.jar
Downloaded: http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.jar (4 KB at 13.3 KB/sec)

并且,在此示例中 - 网址

http://box1:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom 

准确,可以从我的本地工作站和box1环境中解析。

然而。当我深入研究org / apache / maven / plugins / maven-dependency-plugin / 2.1 /的新存储库文件夹(和子文件夹)时 并打开maven-dependency-plugin-2.1.pom我看到网络错误

The page http://www.box1.com/nexus/content/groups/public/org/apache/maven/plugins/maven-dependency-plugin/2.1/maven-dependency-plugin-2.1.pom Cannot be found

请注意以下问题:
www前缀
.com后缀
没有nexus端口

知道错误配置的是什么吗?感觉就像nexus服务器试图按下传入的请求URL并假设(错误地)域后缀和端口?

1 个答案:

答案 0 :(得分:2)

在与城镇周围的一些devop类型的朋友讨论之后,我能够通过在maven settings.xml中添加完全限定的域名来解决这个问题

我把它编辑为

<mirror>
   <id>nexus</id>
   <mirrorOf>*</mirrorOf>
   <url>http://box1.companyName.corp:8081/nexus/content/groups/public</url>
</mirror>

intead of

<mirror>
   <id>nexus</id>
   <mirrorOf>*</mirrorOf>
   <url>http://box1:8081/nexus/content/groups/public</url>
 </mirror>

我的问题已经解决了。