我在尝试使用Maven构建项目时遇到问题。我的网络上有一个nexus服务器,我的所有依赖都来自那里。它有一个中央资源库,它是外部依赖关系的官方maven2存储库的代理,以及一个存储这里所有内部库的存储库。具有多个镜像的Maven项目上的依赖项下载出错
好吧,让我们跳到这个问题。我有我的.m2目录下的文件夹下面的配置:
<settings>
<mirrors>
<mirror>
<id>treto</id>
<name>Tre-to Libs</name>
<url>http://10.163.40.41:8081/nexus/content/repositories/treto-libs/</url>
<mirrorOf>treto-libs,br.jus.treto</mirrorOf>
</mirror>
<mirror>
<id>central</id>
<name>Maven Repository Manager</name>
<url>http://10.163.40.41:8081/nexus/content/repositories/central/</url>
<mirrorOf>central,!treto-libs,!br.jus.treto</mirrorOf>
</mirror>
</mirrors>
...
</settings>
而且在我的项目的POM,我有以下的依赖,从我的联系界面复制该代码:
<dependencies>
<dependency>
<groupId>br.jus.treto</groupId>
<artifactId>tre-auth</artifactId>
<version>0.120</version>
</dependency>
</dependencies>
这种关系应该从“treto”镜像下载,但Maven总是试图从中央镜像中获取镜像,而镜像没有这种依赖关系。
问题是,我在配置上丢失了什么?
它像魔术一样工作!谢谢您的帮助 :) – 2012-02-23 18:03:32