Maven common plug-in instructions for deploy

Maven's deploy plug-in is used to publish the version generated by Maven's automatic build to the central proxy repository such as the Nexus server. It can also publish third-party dependent libraries (such as Jar packages) or an independent Jar package directly to the central proxy repository for everyone to share. use. The following describes the specific usage of the deploy plugin. Assuming the Nexus server has been successfully installed, the Nexus console URL is http://199.3.5.164:8081/nexus.

   1. Automatically build and publish to the Nexus server (assuming the release repository is releases)

      1) Modify the project POM file and add the following content:

  <distributionManagement>
   <repository>
    <id>releases</id>
    <name>Internal Releases</name>
    <url>http://199.3.5.164:8081/nexus/content/repositories/releases</url>
   </repository>
  </distributionManagement>

where the url corresponds to the Releases repository path of the Nexus server, and the id of the repository must be the same as the 3rd) The id of the server in the point is the same. The repository used for publishing must be of type Hosted.

      2) Modify the Releases repository property of the Nexus server.

         Go to the Nexus console and log in with admin. Click "Views/Repositories" and select "Repositories", select Releases in the Repositories list, click configuration, the Deployment Policy defaults to "Disable Redeploy", click to modify it to "Allow Redeploy" and save it.

      3) Modify the settings.xml file in the user directory.

         The settings.xml file path is ${user.home}/.m2 or %{m2_home}/conf/. The Windows7 system directory is C:/Users/username/.m2.

         Find <servers> and modify the information as follows:
<servers>
     <server>
       <id>releases</id>
       <username>deployment</username>
       <password>deployment</password>
     </server>
</servers>

Note: The id of the server must be the same as the id of the repository in point 1). The user name is best to use deployment.

      4) Reset the password of the user deployment.

         Enter the Nexus console, click Security and select Users, right-click the deployment user in the user list, select Set Password to reset the deployment password to "deployment", of course, it can also be set to other, as long as it is consistent with the server configuration in point 3) That's it.

      5) Run "mvn deploy" in the main project directory (where the POM file is located) to build and release the version.

Reprinted from: http://blog.csdn.net/gztly/article/details/6019586

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326975340&siteId=291194637