Nexus3.X Maven project will be uploaded to the PW

The warehouse is divided into two maven, snapshot snapshot repository and release issued warehouse. snapshot snapshot repository for storing unstable version of the development process, release the official repository is used to preserve a stable release. The definition of a component / module for the snapshot version, just in pom file to add -SNAPSHOT (Note that there must be capitalized) in the version number of the module.

 

pom document reads as follows:

<groupId>org.learn.maven</groupId>
<artifactId>mavenweb</artifactId>
<version>1.0-SNAPSHOT</version>


Then the local Maven projects uploaded to the corresponding PW warehouse it?

nexus PW, we can see there are two warehouses is a maven-releases, and the other is just the corresponding maven-snapshots, we can publish items to the appropriate warehouse by configuring

pom.xml configuration file to increase

<! - defined snapshots libraries and library releases the nexus address ->
<distributionManagement>
<Repository>
<the above mentioned id> Maven-releases </ the above mentioned id>
<url>
HTTP: // localhost: 8081 / Repository / Maven-releases /
< / URL>
</ Repository>
<snapshotRepository>
<ID> Maven-snapshots </ ID>
<URL>
HTTP: // localhost: 8081 / Repository / Maven-snapshots /
</ URL>
</ snapshotRepository>
</ distributionManagement>
configuration the url is the url of our nexus in the corresponding warehouse.

 

Setting.xml configuration file, add upload built into the nexus PW in the account and password, if not we will not have permission to upload the configuration to the PW

<servers>
<server>
<id>maven-releases</id>
<username>admin</username>
<password>admin123</password>
</server>

<server>
<id>maven-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
 

The use Maven deploy command uploads

The success of the console output, and then we then view the nexus items uploaded

 

Upload is complete, because the version we pom file in the project is 1.0-SNAPSHOT, so the project will be uploaded to the maven-snapshot directory, if you set a 1.0-RELEASE is uploaded to the maven-release directory.

Guess you like

Origin www.cnblogs.com/panchanggui/p/12110151.html