Maven项目的发布,发布到Nexus

原文:http://blog.csdn.net/mexican_jacky/article/details/50277505

第一步:

配置信息如下:

<!-- 发布项目的配置 -->
  <distributionManagement>
  <repository>
  <id>user-release</id>
  <name>user release version</name>
  <url>http://localhost:8081/nexus/content/repositories/releases/</url>
  </repository>
  <snapshotRepository>
  <id>user-snapshots</id>
  <name>user snapshots version</name>
  <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
  </snapshotRepository>
  </distributionManagement>

对应的节点,会发布到对应Nexus私服服务器上的仓库

第二步:授权

nexus中的用户,那么我们就可以为我们的项目进行授权,需要在settings.xml进行配置

在settings.xml中授权的配置如下:

 <servers>
    <server>
      <id>user-release</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
    
    <server>
      <id>user-snapshots</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
  </servers>

第三步:执行发布

执行之后 我们在Nexus的仓库就可以看到我们所发布的项目

原文地址:https://www.cnblogs.com/shihaiming/p/6197880.html