Cover by Sonatype Company

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Deploying Artifacts to Nexus

Different organizations have different reasons for deploying artifacts to an internal repository. In large organizations with hundreds (or thousands) of developers, an internal Maven repository can be an efficient way for different departments to share releases and development snapshots with one another. Most organizations that use Maven will eventually want to start deploying both releases and artifacts to a shared, internal repository. Using Nexus, it is easy to deploy artifacts to Nexus hosted repositories.

To deploy artifacts to Nexus, supply the repository URL in distributionManagement and run mvn deploy. Maven will push project POMs and artifacts to your Nexus installation with a simple HTTP PUT. No extra wagon extension is needed in your project’s POM. Nexus works with Maven’s built-in wagon-http-lightweight.

Configuring Deployment Security

Nexus ships with a deployment user that has a default password of deployment123. For this chapter, we’ll assume that you are using the default deployment password. To configure Maven to deploy to Nexus, add the following server elements to your ~/.m2/settings.xml file:

<settings> ... <servers> <server> <id>releases</id> <username>deployment</username> <password>deployment123</password> </server> <server> <id>snapshots</id> <username>deployment</username> <password>deployment123</password> </server> <server> <id>thirdparty</id> <username>deployment</username> <password>deployment123</password> </server> </servers> ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required