nexus私服搭建

Windows下使用Nexus2.11私服搭建

下载地址:http://pan.baidu.com/s/1mgirYAG

1.   解压下载的文件后为nexus-2.11.3-01.zipsonatype-work.zip

将两个文件选中解压到一个文件夹里

 

2.   访问 http://repo.maven.apache.org/maven2/.index/ 下载中心仓库最新版本的索引文件,在一长串列表中,我们需要下载如下两个文件(一般在列表的末尾位置,注意.gz下载完的文件大小在185M左右,如果用迅雷下载可能只有130M左右无法使用)  
  nexus-maven-repository-index.gz 
  nexus-maven-repository-index.properties 

3.   下面就是解压这个索引文件,虽然后缀名为gz,但解压方式却比较特别,我们需要下载一个jarindexer-cli-5.1.1.jar,我们需要通过这个特殊的jar来解压这个索引文件

  将上面三个文件(.gz & .properties & .jar)放置到同一目录下,运行如下命令

  java -jar indexer-cli-5.1.1.jar -u nexus-maven-repository-index.gz -d indexer

  等待程序运行完成之后可以发现indexer文件夹下出现了很多文件,将这些文件放置到{nexus-home}/sonatype-work/nexus/indexer/central-ctx目录下(放之前将这里面的所有文件先删除,否则不会生效,这些文件nexus启动就会合并删除),重新启动nexus

  ./nexus restart

上面3个文件的下载地址http://pan.baidu.com/s/1pJknKhX

 

4.   安装nexuswindows

G:\nexus-2.11.3-01\nexus-2.11.3-01\bin\jsw下根据自己的操作系统选择进入,双击install-nexus.bat,点击start-nexus启动nexus或者右击计算机-->管理—>服务nexus启动(可设置自动启动),

输入http://localhost:8081/nexus进入主页



 

点击右上角login 用户名/密码:admin/admin123

5.  仓库设置

点击左侧的repositories



 

除了mvnrepository是我自己添加的,其他的都是默认的,选择central,然后选择下面的configuration



 

点击保存



 

上面为配置好后jar包下载存放的位置,自己修改的路径写在下面的框中即可

右击central更新索引 update index,下面的browse Indexcentral有包即成功



 

6.  安装配置maven(下载解压配置环境变量即可 省略)和settings.xml配置

 

<profile></profile>中添加

<repositories>

      <repository>

        <id>central</id>

        <name>central</name>

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

        <layout>default</layout>

        <releases>

              <enabled>true</enabled>

          </releases>

          <snapshots>

              <enabled>true</enabled>

          </snapshots>

        <snapshotPolicy>always</snapshotPolicy>

      </repository>

  </repositories>

        <activeProfiles>

              <activeProfile>central</activeProfile>

       </activeProfiles>

<mirror></mirror>添加

<mirror>

      <id>nexus</id>

      <mirrorOf>central</mirrorOf>

      <name>nexus</name>

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

 

    </mirror>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值