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>