Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get Nexus to grab artifact files in proxy repositories?

Tags:

maven

nexus

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!

like image 289
Nick Avatar asked Nov 04 '11 20:11

Nick


People also ask

How we can upload artifacts into Nexus repository manager?

First load of the Nexus repository manager admin console. The first thing you need to do is provide the Maven group, artifact, version and packaging attributes for the deployment artifact you are about to upload. After doing so, use the Select Artifacts to Upload button to browse to the JAR file of interest.

Is Nexus an artifact repository?

Nexus Repository OSS is an open source repository that supports many artifact formats, including Docker, Java™, and npm. With the Nexus tool integration, pipelines in your toolchain can publish and retrieve versioned apps and their dependencies by using central repositories that are accessible from other environments.


2 Answers

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..

like image 136
Manfred Moser Avatar answered Oct 06 '22 17:10

Manfred Moser


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.

like image 20
Ken Harris Avatar answered Oct 06 '22 17:10

Ken Harris