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

你可能感兴趣的:(java,maven,jar,snapshot)