自己的maven项目jar包发布到nexus修改maven/settings.xml

来源:互联网 发布:野蔷薇 戴佩妮 知乎 编辑:程序博客网 时间:2024/05/21 19:27

第一步:



配置信息如下:

<!-- 发布项目的配置 -->
  <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的仓库就可以看到我们所发布的项目




0 0
原创粉丝点击