8
votes

My setup is that I have a local Maven repository on my machine, and one on my team's machine that's managed by Nexus. I added a new proxy repository to Nexus. When I select this new proxy repository and hit "Browse Remote", I see everything (all the JARs, POM files, etc.) in the repository, as it should be. But when I click "Browse Storage", I see almost nothing ... only a handful of POM files, and none of the JAR files.

My Maven build is failing, presumably because it can't get the JAR files from Nexus (the JARs don't appear in my local repository, either, but the POMs do). The other virtual repositories on my Nexus all have the JAR files in storage and in my local repository; how can I get Nexus to grab the JAR artifacts from the remote repository?

I'm sure this is something basic, but I've searched and didn't come up with anything I can use. Thank you!

2
I spoke with the person that was formerly responsible for this nexus, and he said that getting the JARs to show up was a painful process of randomly deleting & changing things and restarting the server until it worked, if that's any help.Nick
If thats what he had to do he had no clue... this is not necessary if things are set up correctly.Manfred Moser

2 Answers

12
votes

Enable remote repository index download, add the repository to the public group, make sure that Maven hits Nexus and most importantly read the free book about Nexus.

Here is the chapter about configuring Maven to work with Nexus.

Oh and for proxy repositories it will only download remote artifacts if they are needed e.g. by a Maven build accessing Nexus..

4
votes

I just ran into this issue as well and thought it might help to have another answer.

I have my repository location at: http://serverName.company.com/nexus-2.3 and I copied/pasted that URL into my settings.xml file. That nexus server points to another company's nexus server so that we only have to point to one to pull down our stuff as well as theirs. Unfortunately, I wasn't able to do that.

That is, until I found out that you have to use the following URL instead of the one above: http://serverName.company.com/nexus-2.3/content/groups/public/

The snippet of my settings.xml looks like:

<mirror>
  <id>nexus</id>
  <mirrorOf>*</mirrorOf>
  <url>http://serverName.company.com/nexus-2.3/content/groups/public/</url>
</mirror>

I spent far too long figuring this out. I hope this helps someone in the future.