maven发布项目的snapshot到nexus

1、配置发布地址信息

<repositories>
        <repository>
            <id>nexus</id>
            <name>Local Repository</name>
            <url>http://192.168.8.23:8081/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>offical</id>
            <name>Maven Official Repository</name>
            <url>http://repo1.maven.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>


    <distributionManagement>
        <repository>
            <id>shj-releases</id>
            <name>Internal Releases</name>
            <url>http://192.168.8.23:8081/nexus/content/repositories/shj-releases/</url>
        </repository>
        <snapshotRepository>
            <id>shj-snapshots</id>
            <name>Internal Snapshots</name>
            <url>http://192.168.8.23:8081/nexus/content/repositories/shj-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

2、设置settings.xml

  <servers>
<server>   
        <id>nexus</id>   
        <username>admin</username>
        <password>admin123</password>   
    </server>

      <server>
          <id>shj-releases</id>
          <username>admin</username>
          <password>admin123</password>
      </server>

      <server>
          <id>shj-snapshots</id>
          <username>admin</username>
          <password>admin123</password>
      </server>

  </servers>

 

posted @ 2017-04-12 13:09  旋转的梦  阅读(1486)  评论(0编辑  收藏  举报