Maven Series 6: publish the project to private server

Source: Internet
Author: User

Tag: style blog HTTP color file 2014

1. Modify the deployment policy of the warehouse in the private server

The project of the release version should be released to the releases repository. The corresponding snapshot version should be released to the snapshots repository. Maven determines whether the project is a snapshot version based on whether the attributes of the version <version> node in the Pom. xml file contain-snapshot. If the version is snapshot, Maven Automatically releases the project to the snapshots repository when executing the MVN deploy deployment command. To publish a project, you must first set the "deployment policy" of the releases repository and the snapshots repository to "allow redeploy ":

2. repository deployment for configuration items

In Pom. XML, deploy the repository for the release and snapshot versions respectively. The ID is unique and the URL corresponds to the repository path of the releases and snapshots repositories in the private server respectively:

<Uniqueversion> indicates whether to assign a build number containing the timestamp to the snapshot version. The effect is as follows:

    <distributionManagement>        <snapshotRepository>            <id>user-snapshot</id>            <name>User Porject Snapshot</name>            <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>            <uniqueVersion>true</uniqueVersion>        </snapshotRepository>        <repository>            <id>user-release</id>            <name>User Porject Release</name>            <url>http://localhost:8081/nexus/content/repositories/releases/</url>        </repository>    </distributionManagement>

3. Enable deployment user

By default, nexus has three users. Deployment users are used to deploy projects:

The default deployment user password is deployment123. You can right-click the menu to change or reset the password:

In settings. XML, configure the server for the preceding deployment repository. The ID must correspond to the preceding deployment repository ID:

    <servers>        <server>            <id>user-release</id>            <username>deployment</username>            <password>deployment123</password>        </server>        <server>            <id>user-snapshot</id>            <username>deployment</username>            <password>deployment123</password>        </server>        …            </servers>

4. Publish a project

Right-click Pom. XML-run as-2 Maven build...

After the publishing is successful, you can see the following in the private server Repository:

5. manually upload project components in nexus

On the artifact upload Tab Of The Nexus repository, enter relevant information and manually upload the project component:

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.