Nexus Maven Setup

Source: Internet
Author: User

1, download Nexus installation file: Http://www.sonatype.org/nexus/go, is currently nexus-2.13.0-01-bundle.tar.zip this latest version;

2, extract to any directory, I extracted here to e-disk, into the F:\nexus-2.13.0-01\bin\jsw\windows-x86-64, Click Install-nexus.bat Install to become a Windows service, here choose your own computer corresponding files;

3, visit http://localhost:8081/nexus/, this is the default User name admin default password admin123

5, click on the left repositories, you can see a series of warehouse types, we generally use 3, respectively, Releases,snapshots and 3rd party. These 3 warehouses are installed in stable, development and third-party jar packages.

6, for example, manually upload a jar to the releases warehouse inside.

 

7, the above is a manual way, the other is the use of MVN directly to the above, need to modify 2 places, the first is to join under the Servers node of the settings file, this is the configuration of the password and warehouse, with the warehouse address in the Pom file constitutes the completion of the access to the key elements, The account number and password are set in Settings because the settings file is local and the Pom.xml file is public and unsafe, so it is placed in the settings:

<server>      <id>nexus-releases</id>      <username>admin</username>      < password>admin123</password>    </server>    <server>        <id>nexus-snapshots< /id>        <username>admin</username>        <password>admin123</password>    </ Server>

The second is to add in Pom.xml, and the ID in the following must be the same as the ID in the settings.

    <distributionManagement>        <repository>            <id>nexus-releases</id>            <name> Nexus Release repository</name>            <url>http://localhost:8081/nexus/content/repositories/releases/ </url>        </repository>        <snapshotRepository>            <id>nexus-snapshots</id>            <name>nexus Snapshot repository</name>            <url>http://localhost:8081/nexus/content/ repositories/snapshots/</url>        </snapshotRepository>    </distributionManagement>

Where do the URLs for the two warehouses above get from? Such as:

  

8, a new MVN project,

1, run Source:jar under target to generate the source jar package;

2, the running Deploy,class jar package is released to the service;

3, the operation of Source:jar deploy, together with the source code published to the.

9, complete, in other projects can use the above jar package.

10, A. Paste two previously encountered small anomalies come, in Eclipse configuration mvn can be configured MVN directory and settings files, but it is best that the two are the same version, or there may be problems.

B. We sometimes clearly <dependency> did not write the wrong, but all kinds of error, you can delete the local corresponding jar, re-download, OK.

11, Study advice: mvn this thing, is the difficult person will not, will not be difficult. Basically according to such a route is not a problem, basic use = understand inheritance/aggregation and understanding jar package conflict mechanism, and resolve the conflict = 3 Default declaration cycle of understanding MVN, each stage of the life cycle phase, the goal of each phase Goal = MVN's plug-in development and Nexus building and its use. Roughly such a process down, you can be very familiar with MVN, if in a little look at the source of MVN, roughly look at, basically can be said to be proficient in mvn.

Nexus Maven Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.