`

Nexus搭建自己的私服

 
阅读更多

 

1. 部署环境

linux

jdk

maven

 

2. 安装部署

2.1 下载地址

http://www.sonatype.org/

http://www.sonatype.org/downloads/nexus-2.0.6-bundle.tar.gz

nexus-2.0.6-bundle.tar.gz

 

2.2 安装

2.2.1 解压部署

tar zxvf nexus-2.0.6-bundle.tar.gz

cp -rf nexus-2.0.6-bundle /usr/local/nexus

 

2.2.2 Web服务器使用jetty

修改配置文件nexus.properties

vi /usr/local/nexus/conf/nexus.properties

 

application-port=8080

application-host=0.0.0.0

nexus-webapp=${bundleBasedir}/nexus

nexus-webapp-context-path=/nexus

 

# Nexus section

nexus-work=${bundleBasedir}/../sonatype-work/nexus

runtime=${bundleBasedir}/nexus/WEB-INF

pr.encryptor.publicKeyPath=/apr/public-key.txt

 

修改端口(避免冲突)application-port=8084

 

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

<settings>

 <mirrors>

   <mirror>

     <!--This sends everything else to /public -->

     <id>nexus</id>

     <mirrorOf>*</mirrorOf>

     <url>http://localhost:8084/nexus/content/groups/public</url>

   </mirror>

 </mirrors>

 <profiles>

   <profile>

     <id>nexus</id>

     <!--Enable snapshots for the built in central repo to direct -->

     <!--all requests to nexus via the mirror -->

     <repositories>

       <repository>

         <id>central</id>

         <url>http://central</url>

         <releases><enabled>true</enabled></releases>

         <snapshots><enabled>true</enabled></snapshots>

       </repository>

     </repositories>

    <pluginRepositories>

       <pluginRepository>

         <id>central</id>

         <url>http://central</url>

         <releases><enabled>true</enabled></releases>

         <snapshots><enabled>true</enabled></snapshots>

       </pluginRepository>

     </pluginRepositories>

   </profile>

 </profiles>

 <activeProfiles>

   <!--make the profile active all the time -->

   <activeProfile>nexus</activeProfile>

 </activeProfiles>

</settings>

   

2.2.4 nexus 启动/停止/重启

cd /usr/local/nexus/bin

./nexus start/stop/restart

 

2.2.5 项目pom.xml引用

 

 <pluginRepositories>

        <pluginRepository>

            <id>nexus</id>

            <name>Team Nexus Repository</name>

            <url>http://localhost:8081/nexus/content/groups/public</url>

            <snapshots>

                <enabled>false</enabled>

            </snapshots>

        </pluginRepository>

    </pluginRepositories>

 

3. nexus应用配置

3.1 默认登录

http://localhost:8084/nexus

user:admin

password: admin123

 

3.2 其它配置自己设置

 

4. 参考地址

官网

http://www.sonatype.org/nexus

http://www.sonatype.com/index.php/Support/Books/Repository-Management-with-Nexus?__utma=246996102.759110873.1343122991.1343122991.1343191487.2&__utmb=246996102.10.10.1343191487&__utmc=246996102&__utmx=-&__utmz=246996102.1343122991.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)&__utmv=-&__utmk=77694231

Read Online

http://www.sonatype.com/books/nexus-book/reference/

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics