Publish the maven project to the nexus private server

Source: Internet
Author: User

1. log on to http: // S1: 8081/nexus/index.html and go to the Repositories page.

2. Click the Add button to create a hosted repository. The ID is sheismylife, the name is chenshu repository, and click Save. Created successfully.

3. If a project is to be released, you can manually upload it on the webpage or use the MVN deploy command to deploy it. If it is the latter:

Modify the Pom. xml file

  <distributionManagement>    <repository>      <id>sheismylife</id>      <url>http://S1:8081/nexus/content/repositories/sheismylife</url>    </repository>  </distributionManagement>

4. On the Nexus private server webpage, find security-> Users, find deployment, right-click and select set password to set your password.

At the same time, go to the config page in chenshu repository to allow redeploy.

5. Go back to the development machine and go ~ Add a configuration in/. m2/settings. xml

  <servers>    <server>      <id>sheismylife</id>      <username>deployment</username>      <password>your_pwd</password>    </server>  </servers>

123456 is the password set in step 1.

The error messages of nexus and Maven are unfriendly. Note that there are several basic requirements:

1. Redeploy must be supported in the repository release mode.

2. The values of settings. servers. server. ID in settings. xml must be the same as those of distributionmanagement. repository. ID in POM. xml.

3. It is best to change the deployment user password.

4. Make sure that the repository is added to the public repositories. After selecting the first public repositories in the repositories list, two lists are displayed below. Drag your own repository on the right to the left and save the list.

If a specific error occurs, for example, if I have missing a servers, MVN does not display an error message.

5. when the cause of deployment failure is not found (the error information provided by MVN deploy is usually insufficient), you can manually deploy the service on the nexus private server webpage, and often get a clear error message, it is easy to solve the problem.

6. Do not deploy the snapshot version in the release repository. You will fail. The simplest correction method is to change the version number in POM. XML to 1.0.


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.