If your team treats the public Maven Central like a sketchy buffet then you need a repository manager. Nexus OSS is the no-nonsense repository manager that hosts your private Maven artifacts and proxies remote Maven repositories for CI and local development. This guide walks through a pragmatic setup so you can stop wrestling with dependency hell and start blaming cache policies instead.
java -version
and try not to cry if the JVM is ancient.Unpack the distribution into the directory you intend to run Nexus from and set ownership so the Nexus user can actually read and write files.
tar xvf sonatype-nexus-oss-2.x.y-bundle.tar.gz
sudo chown -R nexus:nexus sonatype-nexus-oss-2.x.y
Start the server with the bundled script and tail the log to watch startup messages.
sudo -u nexus ./bin/nexus start
tail -f sonatype-work/nexus/logs/nexus.log
The default HTTP port is 8081 unless you or that ancient sysadmin changed it. Note the port so Maven and CI can reach Nexus.
Open the Nexus web console in your browser at the host and port from the previous step. Log in with the default admin credentials documented for your Nexus version and immediately change the password. The web UI is where you create repositories, manage users, and break fewer things than you would via config files alone.
Minimal setup for a typical Maven workflow includes:
Give repo names that humans and scripts can live with long term. Avoid whimsical names unless you enjoy painful rename migrations later.
maven-releases
and maven-snapshots
Edit your Maven settings.xml
to add credentials for deploys and a mirror so normal Maven requests go to your Nexus endpoint. Update your projects to point distributionManagement at the hosted repo when you publish artifacts.
Example snippet to add to ~/.m2/settings.xml
:
<settings>
<servers>
<server>
<id>nexus-repo</id>
<username>deploy_user</username>
<password>password_here</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus-mirror</id>
<mirrorOf>central
If your security policy is picky then use Maven's password encryption with the settings security file. That's the grown up way to avoid the stickynote on the monitor approach.
Update your POM with the distributionManagement
coordinates for the hosted repository and run the usual Maven choreography to publish.
mvn deploy
mvn dependency:get -Dartifact=groupId:artifactId:version
Use mvn dependency:get
for quick checks that Nexus is serving the artifact you just pushed. CI pipelines should be configured to authenticate to Nexus for deploy steps and to use the group repo for resolving dependencies.
Snapshots pile up like bad decisions. Configure snapshot cleanup policies and retention rules in Nexus so your disk does not become a shrine to old builds. Set retention rules for both snapshots and releases according to your release cadence and storage budget.
Setting up Nexus OSS as your Maven repository manager gives DevOps teams a controlled artifact management solution for local development and CI. You get hosting, proxying and grouping of Maven repositories along with access controls and retention policies. It is not magic but it is reliable. Document your repo names credentials and policies so future you does not open a ticket that tries to explain this to past you.
If you run into trouble check the Nexus logs, consult Sonatype documentation for your specific Nexus OSS version, and remember that most problems are either permissions or typos. Prefer the former to avoid blaming typos forever.
I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!
This is a dedicated watch page for a single video.