Search code examples
mavenmulenexussonatype

How to determine what repositories I need to add to Sonatype Nexus for Mule ESB


We have been building MuleESB using Maven. Everything has been working fine.

However, we recently added Sonatype Nexus as a repository manager.

Now, building MuleESB using Maven which is now configured to mirror our internal public Nexus URL, many transitive dependencies are not found and the build fails.

I have to go and look which transitive dependency is not found, find which public repository it sits on by looking at the pom files, and then add that as a proxied repository on Nexus. I am repeating this for every unresolved dependency.

Note that I have added the mulesoft releases and snapshot repository. It appears to be the transitive dependencies which are found in other repositories (not the Mulesoft one) which are failing.

What is the best/easiest way to make sure all required repositories are added to our Sonatype Nexus repository?

--- EDIT ---- So far I have found that if I add the following repositories to Nexus, I can build Mule ESB Community Edition as all dependencies are found.


Solution

  • You are following the right process:

    • Identify the repositories you need access to
    • Create a proxy repository for each one, make sure to set the appropriate policy (snapshot vs release), for proxying groups make sure to create two proxy repositories with the same URL and different policy if it has mixed content
    • Add the repositories to the group through which you access the Nexus repository manager, keep in mind that the order in the group is important, keep large, performant ones as well as your internal repositories at the top

    In your list you can probably remove the artifactory repository since the artifacts will be in the other repositories. Also the maven.org (Central Repository) is already preconfigured in the Nexus Repository Manager so you probably don't have to add it.

    It is best to add one repo at a time and try a build either from a fresh install (deleted local Maven repository) or force updates with -U on your mvn invocation.

    If you need more info, you can find all this and more in the documentation.