Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven uses only central repository with Nexus

Tags:

maven

nexus

I've set up Nexus to proxy the central Maven repository and added a mirror to settings.xml:

<mirror>
    <id>nexus</id>
    <mirrorOf>central</mirrorOf>
    <url>http://my-host:8081/nexus/content/repositories/central/</url>
</mirror>

It works fine but if I try to add additional repositories to pom.xml like this:

<repository>
    <id>jboss</id>
    <url>http://repository.jboss.org/nexus/content/repositories/releases/</url>
</repository>

Maven just doesn't see those repositories, until I remove <mirror> from setting.xml. I've also tried to mirror other repositories to Nexus, with no luck: Maven still uses only the central repository.

What am I doing wrong?

like image 880
Vladimir M. Avatar asked Aug 16 '12 13:08

Vladimir M.


1 Answers

Found a whole two ways to solve the problem.

By using profiles: http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html

Or by using grouping in Nexus: http://www.sonatype.com/books/nexus-book/reference/confignx-sect-managing-groups.html

Seems it's helpful to read the documentation before asking questions:)

like image 187
Vladimir M. Avatar answered Oct 22 '22 08:10

Vladimir M.