日期:2014-05-16  浏览次数:20909 次

windows上apache的maven2私服搭建
windows上apache的maven2私服搭建

1、下载WAR包
搭建下载Artifactory
官方地址
http://www.jfrog.org/sites/artifactory/latest/

但是sourceforge被我国封了,所以用以下地址来搜索
http://www.mirrorservice.org/search/?q=artifactory

下载地址如下:
http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/a/ar/artifactory/

下载得来文件如下:
artifactory-1.3.0-beta-2.zip

2、配置私服
双击artifactory.bat,启动默认配置的Artifactory服务。

http://localhost:8081/artifactory/,用admin/password登录进管理界面看看。

修改项目POM.xml

<repositories>
   <repository>
    <id>central</id>
    <url>http://localhost:8081/artifactory/repo</url>
    <snapshots>
     <enabled>false</enabled>
    </snapshots>
   </repository>
   <repository>
    <id>snapshots</id>
    <url>http://localhost:8081/artifactory/repo</url>
    <releases>
     <enabled>false</enabled>
    </releases>
   </repository>
</repositories>
<pluginRepositories>
   <pluginRepository>
    <id>central</id>
    <url>
    http://localhost:8081/artifactory/plugins-releases
    </url>
    <snapshots>
     <enabled>false</enabled>
    </snapshots>
   </pluginRepository>
   <pluginRepository>
    <id>snapshots</id>
    <url>
    http://localhost:8081/artifactory/plugins-snapshots
    </url>
    <releases>
     <enabled>false</enabled>
    </releases>
   </pluginRepository>
</pluginRepositories>

mvn clean dependency:copy-dependencies