Question

I have set up Nexus on and configured it so that it has a repository for my application and also the maven central repository exposed through a group called public and this groups is then added to my pom file:

<repositories>
  <repository>     
    <id>repo1</id>
    <name>my-repo</name>
    <url>http://app1:8081/nexus/content/groups/public</url>     
  </repository>

I am able to browse the index both through eclipse maven repo browser and through a web browser but whenever I try and add a new dependency to the pom I get a missing dependency in my pom file and if I click on one of the jars in the maven repo browser in eclipse, even though it shows up in the tree I get an error message informing me that it could not resolve the artifact.

I want to be able to to disable the maven central mapping from within eclipse and ONLY go my Nexus server which has both maven central and my application specific repos supposedly exposed via the public group.

Can anyone help me with this configuration as currently I cannot resolve any new dependencies in any projects, I tried creating a new Spring MVC project and the only dependencies that resolved ok were the ones in my local maven respository.

Any help is appreciated.

Was it helpful?

Solution

The best way to enforce that only Nexus is used for artifact download is to set up a mirror in your settings.xml file. See here for information on how to do that:

http://books.sonatype.com/nexus-book/reference/maven-sect-single-group.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top