1. Install Nexus
Here is the installation with homebrew, Brew nexus
After the installation is successful, the default access port is 8081, and my access address here is http://192.168.99.100:8081
Default User: admin password: admin123
2. Set the release configuration of the Nexus to allow publishing
3. Set the deployment user password for the Nexus
4. Modify the local MAVEN configuration file to add the server
Open the local settings.xml, find <servers>, add the following configuration
<server>
<id>snapshots</id>
<username>deployment</username>
<password>123456</password>
</server>
<server>
<id>releases</id>
<username>deployment</username>
<password>123456</password>
</server>
The password here is the password you just set.
5. Modify the Pom.xml configuration of the project to be published
Add the following configuration:
<distributionManagement>
<repository>
<id>releases</id>
<url>http://192.168.99.100:8081/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://192.168.99.100:8081/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
Note: The ID here is the same as the ID you just added in the settings.xml file
6. Create a project skeleton
Execute at the root of the project
# MVN Clean
# mvn Archetype:create-from-project (this command generates archetype related files)
# CD target/generated-sources/archetype/(you can see the newly generated files in this directory)
Publish to Local:
Execute MVN Install
Publish to:
In this directory Pom.xml add the fifth step of the configuration
Perform mvn deploy
Maven Publish to