Reputation: 3016
I've got some trouble using Nexus and Maven. When I try to build projects with Maven using the Nexus, Maven is not able to find any artifact. I added this to the Maven Settings:
<mirror>
<id>nexus</id>
<url>http://localhost:6060/nexus/content/groups/public</url>
<mirrorOf>central</mirrorOf>
</mirror>
to connect Maven with the Nexus. The Maven central repo is also defined in the Nexus settings
Upvotes: 0
Views: 1171
Reputation: 97379
Based on the documentation of Nexus you should configure the settings.xml file like the following:
The most important thing is that mirrorOf contains only an single asterik to get all request redirected to the configured Nexus instance.
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Upvotes: 1
Reputation: 1510
You can try like this :
<mirror>
<id>nexus-local</id>
<url>http://localhost:6060/nexus/content/groups/public/</url>
<mirrorOf>external:*</mirrorOf>
</mirror>
Upvotes: 1