I'm having a problem when I'm trying to build a project with Maven. I have a nexus server on my network and all my dependencies comes from there. It have a central repository which is a proxy to the oficial maven2 repository for external dependencies and a repository that store all internal libraries from here.
Well, let's jump to the problem. I have the following configuration on my .m2 folder:
<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>
And on my project's pom I have the following dependency, which the code I copied from the nexus interface:
<dependencies>
<dependency>
<groupId>br.jus.treto</groupId>
<artifactId>tre-auth</artifactId>
<version>0.120</version>
</dependency>
</dependencies>
This dependency is supposed to be downloaded from the "treto" mirror, but Maven is always trying to get it from the central mirror, which doesn't have that dependency.
The question is, what am I missing on the configuration?
You should have, in you pom.xml or settings.xml (in a profile), this kind of declaration :
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>treto</id>
<name>Tre-to Libs</name>
<url>http://10.163.40.41:8081/nexus/content/repositories/treto-libs/</url>
</repository>
</repositories>
Then, your mirrors should be :
<mirrors>
<mirror>
<id>central</id>
<name>Maven Repository Manager</name>
<url>http://10.163.40.41:8081/nexus/content/repositories/central/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
You can tell maven to use your mirror for everything except treto:
<mirrorOf>*,!treto</mirrorOf>
or only use it for central
<mirrorOf>central</mirrorOf>
Post your full pom and settings if this don't work ;);)