Archiva Standalone搭建自己的私服

1. 部署环境

linux

jdk

maven


2. 安装部署

2.1 下载地址

http://archiva.apache.org/#a

Archiva 1.3.5 Standalone

http://mirror.bjtu.edu.cn/apache/archiva/binaries/apache-archiva-1.3.5-bin.tar.gz 

apache-archiva-1.3.5-bin.tar.gz 

2.2 安装

2.2.1 解压部署

tar zxvf apache-archiva-1.3.5-bin.tar.gz

cp -rf apache-archiva-1.3.5-bin /usr/local/archiva

2.2.2 Web服务器使用jetty

修改配置文件

vi /usr/local/archiva/conf/jetty.xml

修改端口(避免冲突):

<Call name="addConnector">

     <Arg>

         <New class="org.mortbay.jetty.nio.SelectChannelConnector">

           <Set name="host"><SystemProperty name="jetty.host"/></Set>

           <Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>

           <Set name="maxIdleTime">30000</Set>

           <Set name="Acceptors">2</Set>

           <Set name="statsOn">false</Set>

           <Set name="confidentialPort">8443</Set>

           <Set name="lowResourcesConnections">5000</Set>

           <Set name="lowResourcesMaxIdleTime">5000</Set>

         </New>

     </Arg>

   </Call>

   

   default="8080" 修改为 default="8084"

   

2.2.3 修改Maven配置文件/root/.m2/setting.xml 如果不存在就新建

<settings>

 <mirrors>

   <mirror>

<id>internal</id>

<name>Proxy Cache - Internal Repository</name>

<url>http://localhost:8084/archiva/repository/internal</url>

<mirrorOf>*</mirrorOf>

    </mirror>

 </mirrors>

</settings>

   

2.2.4 archiva 启动/停止/重启

cd /usr/local/archiva/bin

./archiva start/stop/restart

问题:

/lib/libc.so.2问题

yum install glibc.i686

3. Archiva应用配置

3.1 配置用户

自己填就可以了

3.2 配置Repositories

系统默认配置2个

基本上没法用

添加一个PUBLIC:

Add URL:http://repository.sonatype.org/content/groups/public/

信息:

Identifier repository.sonatype.org

Name sonatype

URL http://repository.sonatype.org/content/groups/public/

Type Maven 2.x Repository

3.3 配置Proxy Connectors

系统默认配置2个

添加一个:

repository.sonatype.org

sonatype

http://repository.sonatype.org/content/groups/public/

3.4 修改Repositories

编辑Archiva Managed Internal Repository

修改Directory指定到/usr/local/archiva/data/repositories/internal

编辑Archiva Managed Snapshot Repository

修改Directory指定到/usr/local/archiva/data/repositories/internal

4. 配置检查

cd /root/./m2

maven快速构建

mvn -X archetype:generate

Maven中的依赖关系查看

mvn -X dependency:resolve


5. maven 仓库地址

共有的仓库 

http://repo1.maven.org/maven2/ 

http://repository.jboss.com/maven2/ 

http://repository.sonatype.org/content/groups/public/ 

http://mirrors.ibiblio.org/pub/mirrors/maven2/org/acegisecurity/ 

私有的仓库 

http://repository.codehaus.org/ 

http://snapshots.repository.codehaus.org/ 

http://people.apache.org/repo/m2-snapshot-repository 

http://people.apache.org/repo/m2-incubating-repository/ 

好用:

http://repository.sonatype.org/content/groups/public/


参考地址:

官方guide

http://archiva.apache.org/docs/1.3.5/adminguide/standalone.html

maven常见问题

http://tianya23.blog.51cto.com/1081650/289363

maven plugins

http://maven.apache.org/plugins/index.html

maven 查找依赖jar的dependency标签 地址

http://mvnrepository.com/

安装学习

http://jansel.iteye.com/blog/338783

你可能感兴趣的:(arc)