Maven自动发布构件到远程中央仓库

通过Maven自动发布构件到远程中央仓库-Nexus

1.在maven项目的pom里配置如下信息

<distributionManagement>

    <repository>

        <id>nexus-releases</id>

        <url>http://172.0.0.1:8081/nexus/content/repositories/releases/</url>

    </repository>

    <snapshotRepository>

        <id>nexus-snapshots</id>

        <url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>

    </snapshotRepository>

</distributionManagement>

 

2.在setting.xml里配置下面的信息

<servers>

    <server>

     <id>nexus-releases</id>

     <username>admin</username>

     <password>***</password>

   </server>

    <server>

     <id>nexus-snapshots</id>

     <username>admin</username>

     <password>***</password>

   </server>

</servers>

3.自动发布构件到远程中央仓库-Nexus

Maven命令:mvn deploy

你可能感兴趣的:(Maven自动发布构件到远程中央仓库)