Artifactory 安装配置

一个团队要真正用好Maven,repository私服是免不了的,否则team mate们多好奇的目光,都会全部消耗在漫长的jar下载中。

    以前介绍过一个搭建私服的简朴但很笨的办法:将雷锋同志下载好的.m2/repository目录整个上传到任意的Web服务器中。其实世上多的是专业的maven私服搭建器,见TheServiceSide的文章--Setting Up a Maven Repository

    我用的是Artifactory,安装的时候觉得,Java的服务应用啥时候终于变得这么好用了,什么都不用装不用配,双击artifactory.bat,自己就会启动Jetty Web服务器与自带的存储系统,拆箱即用。

    10分钟入门到开动

  • 双击artifactory.bat,启动默认配置的Artifactory服务。
  • http://localhost:8081/artifactory/,用admin/password登录进管理界面看看。
  • 修改自己项目的pom.xml,增加私服定义
        <repositories>
            <repository>
                <id>artifactory</id>
                <name>your local artifactory</name>
                <url>http://localhost:8081/artifactory/repo</url>
            </repository>
        </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>artifactory</id>
            <name>your local artifactory</name>
            <url>http://localhost:8081/artifactory/plugins-releases</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
  • 正常运行项目的maven命令,向artifactory索求jar。如果artifactory已经下载了就会直接返回给你,还没有的就会去那几个repo官方站下载。进入到artifactory的管理界面,不断刷新Browse the repository,会看到仓库不断丰富的情况。

进一步配置

  • 官网服务器上还没有的一些jar,也可以通过管理界面很方便的deploy到Artifactory中。
  • 如果你团队里的artifactory服务器不能直接连外网,需要使用HTTP代理服务器的话,见http://www.jfrog.org/sites/artifactory/latest/configuration.html
  • 如果你团队里的artifactory服务器网速较慢,在remote-repo处可以配socketTimeoutMillis,默认是5000毫秒。
  • artifactory默认了一些站点,如果需要更多,也可以修改配置文件文件。

 在Tomcat部署Artifactory.  

      Artifactory is a standard Java EE web application. As such, it can be installed and run on any 2.5 compliant Servlet Container. The instructions below refer to installation on Tomcat 5.5 and above, though we have many reports about Artifactory running seamlessly on JBoss, BEA Weblogic, IBM Websphere, etc.

    Startup the Servlet Container VM with -Dartifactory.home=$ARTIFACTORY_HOME, pointing to the location of your Artifactory home folder (If you do not specify this property it will default to ${user.home}/.artifactory).

Alternatively, you can also set an ARTIFACTORY_HOME environment variable to point to your Artifactory home folder.
      Make Sure the folder is writable  by the user running the Servlet Container.
Artifactory will try to create the folder on startup if it does not exist.

Make sure the Artifactory configuration file $ARTIFACTORY_HOME/etc/artifactory.config.xml and the log4j configuration file $ARTIFACTORY_HOME/etc/log4j.properties exist in their respective locations.

Deploy the artifactory.war file into the container.

 

 

ref :

 

http://www.theserverside.com/tt/articles/article.tss?l=SettingUpMavenRepository

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值