MAVEN's Pom.xml file structure environment configuration Distributionmanagement

Source: Internet
Author: User

In the MAVEN project's POM, environment configuration <distributionManagement> is responsible for managing the release of artifacts.

Of course, the complete configuration also requires the server server-related parameters of the component library to be configured in Settings.xml.


Basic configuration of 1.<distributionmanagement>

  <distributionManagement> ...
    <downloadUrl>http://jcat.myserver.org/my-project</downloadUrl>
    <status>deployed</ Status>
  </distributionManagement>
Description: DownloadURL, a URL that other MAVEN projects can use to download and reference the artifacts of the current MAVEN project. Note The URL in the url,<repository> in <repository> below in this article gives the publication URL of the artifact for the current MAVEN project. Status, the state of the current MAVEN project, and the available states are as follows. Note that this value is set automatically by Maven and never manually set. None, unspecified state, default value converted, the artifact of the MAVEN project has been converted to Maven 2 partner, and the artifact of the MAVEN project remains consistent with the MAVEN version of the other library deployed The components of the MAVEN project are published through MAVEN 2 or Maven 3, the most common values verified, and the artifacts of the MAVEN project have been validated


<repository> Configuration of 2.<distributionmanagement>

Gives the configuration of the remote library when MAVEN deploys the artifacts from the current project to the remote library. Examples are as follows:

  <distributionManagement>
    <repository>
      <uniqueVersion>false</uniqueVersion>
      <id>corp1</id>
      <name>corporate repository</name>
      <url>scp://repo/ maven2</url>
      <layout>default</layout>
    </repository>
    <snapshotrepository >
      <uniqueVersion>true</uniqueVersion>
      <id>propSnap</id>
      <name> Propellors snapshots</name>
      <url>sftp://propellers.net/maven</url>
      <layout> Legacy</layout>
    </snapshotRepository> ...
  </distributionManagement>
Specific configuration parameters, refer to the previous article.

3. <distributionManagement> <site> Configuration

In addition to deploying the artifacts of the current MAVEN project, you can also deploy the sites and documents for the current MAVEN project. Examples are as follows:

  <distributionManagement> ...
    <site>
      <id>mojo.website</id>
      <name>mojo website</name>
      <URL>SCP ://beaver.codehaus.org/home/projects/mojo/public_html/</url>
    </site> ...
  </distributionManagement>
The configuration parameters here are consistent with the corresponding configuration parameters in <repository>.

4. <distributionManagement> <relocation> Configuration

As a maven project grows, the artifacts of the MAVEN project may need to be republished to a new library. <relocation> can publish the current MAVEN project as a new artifact to another library. Examples are as follows:

  <distributionManagement> ...
    <relocation>
      <groupId>org.apache</groupId>
      <artifactid>my-project</ artifactid>
      <version>1.0</version>
      <message>we have moved the Project under Apache </message>
    </relocation> ...
  </distributionManagement>


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.