阿里云esc 搭建私服 并 更新 中央仓库索引

1. 下载私服软件:

  下的时候下载不了,被q了,于是从别的地方找了一个2.12.0-01 版的上传到 esc 上

  已保存至百度云:

链接:https://pan.baidu.com/s/1rSFXyjidqXgbyez4ygBE9g
提取码:odwc

2. 解压到  /usr/local 下的: tar zxvf  nexus-2.12.0-01-bundle.tar.gz  -C /usr/local

3. nexus 默认端口是 8081,怕后期与自己项目有冲突,就改成了 9081

  通过 vim 修改 nexus.properties 这个配置文件: vim /usr/local/nexus/nexus-2.12.0-01/conf/nexus.properties

   

 4. 进入bin 目录下启动服务:

cd /usr/local/nexus/nexus-2.12.0-01/bin/

也可以直接:  /usr/local/nexus/nexus-2.12.0-01/bin/nexus start (无论当前在哪个目录下,都可以通过绝对路径的方式)

扫描二维码关注公众号,回复: 7278850 查看本文章

 5. 构建中央仓库的索引库:

(1) wget 命令下载 索引压缩文件:  wget http://repo.maven.apache.org/maven2/.index/nexus-maven-repository-index.gz

(打开链接: http://repo.maven.apache.org/maven2/.index    找到 nexus-maven-repository-index.gz ,右键“复制链接地址”,粘到 esc 窗口)

(2)桌面创建一个记事本,将

http://repo.maven.apache.org/maven2/.index/  下 名为  nexus-maven-repository-index.properties 里的内容粘进去

就是下面这个截图文件:

 

文件也命名为:nexus-maven-repository-index.properties

(3) wget 命令下载 indexer-cli:wget https://repo1.maven.org/maven2/org/apache/maven/indexer/indexer-cli/5.1.1/indexer-cli-5.1.1.jar

  A.  百度搜索: indexer-cli ,选择第一个,点进去

  B.  jar—>右键 复制链接地址,粘到 esc 窗口

上述两个 包是因为 下到本地网比较慢,再上传,也麻烦,所以干脆下到 esc 上了

上传 nexus-maven-repository-index.properties 文件到 ecs 上,上述 俩包和 这个文件 建议放在一个目录下

(4) 通过 indexer-cli-5.1.1 将 nexus-maven-repository-index.gz 里的文件解压到 名为 central-ctx 的目录下(没有会自动创建) 下:java -jar indexer-cli-5.1.1.jar -u nexus-maven-repository-index.gz -d central-ctx

6. 停止 nexus 服务:  /usr/local/nexus/nexus-2.12.0-01/bin/nexus stop

7. 删除 sonatype-work/nexus/indexer 下的 central-ctx 目录:rm -rf central-ctx  (建议先将这个目录下载下来,玩不转时可以恢复) 或者 rm -rf /usr/local/nexus/sonatype-work/nexus/indexer/central-ctx

8. 将 5中 第四步名为 central-ctx 移动到 sonatype-work sonatype-work/nexus/indexer 下

9. 启动 nexus 即可更新 nexus 上 中央仓库的索引

猜你喜欢

转载自www.cnblogs.com/wtx106/p/11519213.html