How to publish project to Nexus private server in Maven

Environment of this article

  • nexus-3.55.0-01, Nexus is installed on the local server http://localhost:8081/
  • maven-3.9.2

release steps

  1. Configure the Nexus account/password in the Maven settings.xml of the project machine. Add a node
    in the settings.xml node , and configure the Nexus login account and password. This is using the admin/123456 login.<servers><server>
    <server>
      <id>osxm-nexus</id>
      <username>admin</username>
      <password>123456</password>
    </server>

The effect after configuration is as follows:
insert image description here

  1. Configure the address of the published private library in the pom.xml of the project

Configure the distributionManagement node in pom.xml as follows:

  <distributionManagement>
		<repository>
			<id>osxm-nexus</id>
			<name>Osxm Nexus Releases Repository</name>
			<url>http://localhost:8081/repository/maven-snapshots/</url>
		</repository>
  </distributionManagement>
  • Here is an example of publishing the project to the snapshot library maven-snapshot
    configuration as follows:

insert image description here

  1. mvn deployExecute and publish at the root path of the source code project

insert image description here

  1. After the release is successful, enter Nexus to see the released library.

insert image description here



Guess you like

Origin blog.csdn.net/oscar999/article/details/131349583