1. 程式人生 > >maven上傳snapshot.jar到遠端倉庫

maven上傳snapshot.jar到遠端倉庫

專案pom檔案中配置

<project>

  ...................

    <distributionManagement>  
        <repository>  
            <id>releases</id>  <!-- mavensettings檔案中的id-->
            <name>Release Repository</name>  
            <url>http://....../content/repositories/releases/</url>  <!-- maven 遠端倉庫地址-->
        </repository>  
        <snapshotRepository>  
            <id>snapshots</id>    <!-- mavensettings檔案中的id-->
            <name>Snapshot Repository</name>  
            <url>http://......./content/repositories/snapshots/</url>   <!-- maven 遠端倉庫地址-->
        </snapshotRepository>  
    </distributionManagement>

</project>

maven安裝目錄下的settings檔案也需要更改

<servers>

    <server>  
      <id>releases</id>   <!-- 對應pom中的id-->
      <username>username</username>  
      <password>password</password>  
    </server>  
    <server>  
      <id>snapshots</id>    <!-- 對應pom中的id-->
      <username>username</username>  
      <password>password</password>  
    </server>
  
  </servers>

參考:http://zyl.iteye.com/blog/41612