MAVEN遠程發佈配置

1、maven目錄conf的setting.xml裏配置:java

<servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     | 
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are 
     |       used together.
     |
    -->
    <server>    
      <id>nexus-releases</id>    
      <username>admin</username>    
      <password>admin123</password>    
    </server>    
    <server>    
      <id>nexus-snapshots</id>    
      <username>admin</username>    
      <password>admin123</password>    
    </server>   
    
    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
  </servers>

2、pom.xml文件配置maven

<distributionManagement>
     <repository>
        <id>nexus-releases</id>
        <name>releases</name>
        <url>http://172.56.3.242:8081/nexus/content/repositories/releases</url>
      </repository>
    <snapshotRepository>
        <id>nexus-snapshots</id>
        <name>snapshots</name>
        <url>http://172.56.3.242:8081/nexus/content/repositories/snapshots</url>
     </snapshotRepository>
  </distributionManagement>


3、執行mvn命令
  1. 本地倉的更新ide

    • mvn  clean package install
      url

  2. 遠程的更新spa

    • mvn clean package deploycode

相關文章
相關標籤/搜索