Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add dependencies to 3rd party library using nexus/maven

i'm trying to use Nexus + m2eclipse/maven-3 professionnally, and i've got a huge 3rd party library that needs a lot of dependencies.

Is there any ways to ease my pain by uploading to Nexus this third party library with all its dependencies linked, so that anyone who would need it would just have to add the maven-dependency-tag only for this huge library ?

Do i need to create the pom myself ?

thank you for your help.

like image 411
Olivier Girardot Avatar asked Jun 15 '10 09:06

Olivier Girardot


People also ask

Can Nexus repository store 3rd party jars?

Ability to host third party artifacts. Instead of hosting the jar locally, we can host it in the nexus repository which will be shared across developers and also maintained in the local cache.

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.


2 Answers

Is there any ways to ease my pain by uploading to Nexus this third party library with all its dependencies linked, so that anyone who would need it would just have to add the maven-dependency-tag only for this huge library?

I'm not aware of such a facility.

Do I need to create the pom myself ?

I would not create the POM for the thirdparty dependency but I would indeed consolidate dependencies in a single POM project (and upload it to Nexus).

like image 160
Pascal Thivent Avatar answered Sep 28 '22 06:09

Pascal Thivent


For future visitors, I was able to add a dependency to a 3rd party artifact within nexus, if you wish to do it this way. I followed the following steps:

  1. Create the pom file you want for the 3rd party dependency (I downloaded the existing, auto-generated pom in nexus, then added the dependency that I wanted).

  2. Delete the pom file and it's friends (the SHA1 and MD5 files). I did this through the UI.

  3. Upload the pom file through the artifact upload tab, using the same GAV information, with the artifact type being a pom file.

  4. Celebrated that it was this straightforward.

Hope that helps.

like image 22
Noremac Avatar answered Sep 28 '22 05:09

Noremac