0
votes

I have a Nexus OSS server configured as my Repository. I'm trying to configure the settings.xml to this server and central:

   <settings>
  <servers>
        <server>
            <id>nexus</id>
            <username>admin</username>
            <password>admin123</password>
        </server>
    </servers>

  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>   
  </mirrors>


</settings>

In my Nexus Repo (http://localhost:8081/nexus/content/groups/public/) i just have the following files (i uploaded the mylib.jar in thirdparty repo):

archetype-catalog.xml   Fri May 27 12:17:45 BRT 2016    25  

But when i tried to mvn:install the maven don't find my JAR in Thrid Part repository, i got the error:

The POM for br.com:mylib:jar:2.0 is missing, no dependency information available
1
Does this help? stackoverflow.com/questions/36757902/… it explains the mirror configuration (and will show that you have a weird config here, mainly mirroring central to point at it again).Tunaki
Cool, i read everything but i have a doubt. The maven give preferences to <repository> instead of <mirror> ? So, i can have <repository> without <mirror> but i can't have <mirror> without <repository> right ?Ronaldo Lanhellas
Yes, you can mirror central which is Maven Central and present by default without configuring it with a repository.Tunaki
As i said i have a Nexus server (showed in settings.xml as <mirrorOf>*) , i need a repository ? I'm asking this because i can't find my jar, the maven throws a exceptionRonaldo Lanhellas
Well, I'd try to remove your <repositories> declaration since you don't need them, then your <mirrorOf>central</mirrorOf> also, you don't need it and it's confusing. Then you need to make sure that http://localhost:8081/nexus/content/groups/public/br/com/mylib/2.0/mylib-2.0.jar exists.Tunaki

1 Answers

0
votes

Your mirror settings will work. I almost said they were "fine" but that's an overstatement. They should work for the situation you have presented.

IF:
You succesfully loaded br.com:mylib:2.0 into the thirdparty repo (are you sure? It should probably be com.br, but what do I know...)
AND:
You can find it in the thirdparty repo within the nexus browser
THEN:
You should be able to resolve it without specifying any additional repositories.

Sounds like your config of Nexus doesn't have your third-party library in the groups/public group, which is what you're using as your mirror source for central.

Make sure that public includes thirdparty

I use Nexus 3 which, by default, doesn't include any such repository.