G'day all ... I have been looking at stackoverflow about the use of a local or cluster nexus repository. Anyway I've had a Nexus repository on my PC and my laptop for a number of years with little bother.
I think more projects are using Nexus themselves and I've had three or four issues just in the last few weeks (since December) where there can be clashes with any artefact from an id of: "central". I'm seeing problems like this one more often:
On my laptop, I seem to have resolved problems to date, by naming the main repository (something like) "nexus-local". But not on my desktop workstation. Strange.
How strange? Well an empty 'archetype' project for Vert.X with the same attributes compiles fine on the laptop and fails on the workstation, complaining about not finding something from a "central" named repository.
Upon inspection, I noticed that even though I've renamed the workstation repository as "nexus-local" there's some internal ID that remains "central".
There are Nexus repository settings files, e.g. nexus.xml
, showing the internal(??) central name/Id. So the question viewers ...
Alternatively, is there a simple demo for a maven/nexus setup cookbook some place that doesn't require me to read 3 x books first and compiling the knowledge for a simple-solo set-up?
Would dropping Nexus altogether and restarting the server 'fix' this kind of issue?
Maven 3 has a built in repository called "central" and you need to override this in your settings.xml as described in the Nexus documentation. You then combine this with a repository group of any name and use that as a mirrorOf * (including central).
The repository group can contain any repositoy you like as well. The default is that it contains a proxy repository of the Central Repository and the three hosted repositories releases, snapshots and thirdparty.
If you need more .. you just add them to the group.
And if you are looking for a simple step by step example .. check out the Nexus eval guide chapter about proxy and publish and the used example project.