maven构建的项目 发布jar到nexus上

 发布我们项目组的jar包的方法如下:
 1)在setting.xml中配置
 <servers>
  <server>  
        <id>releases</id>  
   <username>admin</username>  
   <password>admin123</password>  
   </server>  
   <server>  
  <id>Snapshots</id>  
  <username>admin</username>  
  <password>admin123</password>  
  </server>   
 </servers>  
 
2) 在pom.xml中配置:
<repositories>
 <repository>
  <snapshots>
  <enabled>true</enabled>
  </snapshots>
  
  <id>public</id>
  <name>Public Repositories</name>
  <url>http://172.21.20.93:8081/nexus/content/groups/public/</url>
 </repository>
</repositories>
<pluginRepositories>
 <pluginRepository>
  <id>public</id>
  <name>Public Repositories</name>
  <url>http://172.21.20.93:8081/nexus/content/groups/public/</url>
 </pluginRepository>
</pluginRepositories>

 <distributionManagement>
  <repository>
   <id>releases</id>
   <name>Local Nexus Repository</name>
   <url>http://172.21.20.93:8081/nexus/content/repositories/releases/</url>
  </repository>
  <snapshotRepository>
   <id>Snapshots</id>
   <name>Local Nexus Repository</name>
   <url>http://172.21.20.93:8081/nexus/content/repositories/snapshots</url>
  </snapshotRepository>
 </distributionManagement>  

你可能感兴趣的:(maven构建的项目 发布jar到nexus上)