Nexus私服安装配置常用问题

maven私服安装配置

软件安装及基本配置

安装配置

# 安装jdk,参考其他教程
mkdir -p /app/nexus2
# 创建目录
wget https://download.sonatype.com/nexus/oss/nexus-2.14.8-01-bundle.tar.gz
# 解压
tar -zxvf nexus-2.14.8-01-bundle.tar.gz
# 修改配置, 在头部添加配置"export RUN_AS_USER=root"
vim /etc/profile
source /etc/profile
# 进入目录
cd /app/nexus2/nexus-2.14.8-01/bin
# 启动maven
./nexus start
# 浏览器访问http://172.16.48.129:8081/nexus/

配置文件夹以及路径

/app/nexus2/nexus-2.14.8-01/conf

日志文件夹以及路径

/app/nexus2/nexus-2.14.8-01/logs

软件索引配置

索引数据目录:sonatype-work/nexus/indexer

  1. nexus更新索引,设置中进行同步设定
  2. 手动更新索引

手动更新所需文件准备:

  1. nexus-maven-repository-index.gz
  2. nexus-maven-repository-index.properties

    在maven的官方网站能够找到:http://repo.maven.apache.org/maven2/.index/

  3. indexer-cli-5.1.1.jar

    在maven网站中搜索indexer-cli找寻对应的版本号:http://search.maven.org/

更新索引:

# 安装jdk先决条件,后续需要使用java命令进行索引解压缩处理
# 进行这些操作的时候,最好停止nexus服务器,./nexus stop 防止出现异常情况
# 创建索引压缩包放置目录
mkdir -p /app/nexus/index
# 将文件上传到服务器在同一个目录下面
ll
# 运行结果
-rw-r--r-- 1 root root   6576184 11月  1 10:34 indexer-cli-5.1.1.jar
-rw-r--r-- 1 root root 578261578 11月  1 10:34 nexus-maven-repository-index.gz
-rw-r--r-- 1 root root      1130 11月  1 10:34 nexus-maven-repository-index.properties
# 解压缩索引文件,需要等待完成,中途中断,请删除生成文件夹重新执行命令
java -jar indexer-cli-5.1.1.jar -u nexus-maven-repository-index.gz -d indexer
# 运行结果
Index Folder:      /app/nexus/index
Output Folder:     /app/nexus/index/indexer
Total time:   7 min 7 sec
Final memory: 77M/131M
# 将解压出来的/app/nexus/index/indexer的所有文件,拷贝到nexus工作目录中的indexer的/app/nexus/sonatype-work/nexus/indexer/central-ctx中央仓库的索引目录中
rm -rf /app/nexus/sonatype-work/nexus/indexer/central-ctx/*
cp -r /app/nexus/index/indexer/* /app/nexus/sonatype-work/nexus/indexer/central-ctx
# 启动nexus,./nexus start进入中央仓库,刷新所有即可,并且设置与中央仓库的同步

仓库迁移设置

Nexus的构件仓库都保存在sonatype-work目录中,该目录的位置由nexus/conf/nexus.properties配置文件指定。

仓库迁移需要两个过程:备份和还原

备份仓库:将sonatype-work文件夹整体备份即可,也可以选择只备份最重要的两个文件夹索引(indexer)和仓库(storage)

还原仓库:将备份好的sonatype-work文件拷贝到新的服务器中。然后修改nexus/conf/nexus.properties配置文件,重新指定仓库的目录。

Jar包搜索优化

将public仓库关联上所有的仓库,方便查找,如下图:

快照版本清理设定

添加任务:http://crabdave.iteye.com/blog/2358012

官方博客介绍:https://blog.sonatype.com/2009/09/nexus-scheduled-tasks/

参考资料:

设定开机启动:https://blog.csdn.net/zsg88/article/details/76099807

常用配置:https://blog.csdn.net/kinglyjn/article/details/53585721

原文地址:https://www.cnblogs.com/fly-piglet/p/9888911.html

时间: 2024-08-26 12:39:55

Nexus私服安装配置常用问题的相关文章

Nexus 私服安装配置(一) - 浮塵的博客

mavenCentral 是最早的 maven 中央仓库,Nexus 是常用的私用 Maven 服务器, Nexus 被超过10万个开发团队所使用. 下载Nexus-3.16.1 unix 准备工作 java 环境(最好yum,不用自己配置java HOME),不详细说google Nexus 安装目录及用户 Nexus tar [curl or wget] Nexus 目录及用户 Folder cd /opt wget https://*/**/nexus-3.16-*.tar.gz mkdi

9.Nexus私服安装配置

第一步:下载nexus-webapp-1.9.2.4.war包,然后拷贝到tomcat下的webapps目录中 第二步:启动tomcat 第三步:访问http://localhost:8080/nexus/显示如下: 第四步:点击右上角"log in"  ,输入username:admin和Password:admin123登录 第五步:登录成功 第六步:点击Views/Repositories中Repositories Nexus内置仓库说明: (1)Maven Central:该仓

TortoiseSVN下载,安装,配置,常用操作 svn教程

   TortoiseSVN下载,安装,配置,常用操作 svn教程 首先在百度搜索并下载 TortoiseSVN 推荐从官网下载,软件分为32位和64位版本,下载时请根据自己的系统位数进行下载:  安装过程: 1.下载软件后,双击程序进行安装,点击"Next": 2.在许可证协议页面,选择"I Accept the terms in the License Agreement",点击"Next": 3.在自定义选项页面,可以选择安装目录,也可以直

Maven使用Nexus私服的配置

工作记录 —————————————————————————————— 配置文件 apache-maven-3.3.3\conf\settings.xml 在mirrors(镜像)之间配置. url为私服地址 <!-- 配置maven只使用私服时,第一个mirrorOf之间写*就行.osgeo和geosolutions不能使用nexus,必须绕过--> <mirror> <id>nexus</id> <mirrorOf>external:*,!o

nexus私服安装

一.搭建nexus私服.当前服务器版本是jdk1.8    . nexus安装包下载:http://www.sonatype.org/nexus/archived 先是下载目前最新的版本 Nexus 2.11.1-01 2014-12-22 有提供zip和tar.gz格式,随便下哪种都可以. 二.解压之后会有两个文件夹,nexus-2.11.1-01和sonatype-work,我们进入第一个文件夹的bin目录来启动nexus . 1.进入启动目录,启动 cd /home/nexus/nexus

linux 搭建 nexus 私服及配置

安装篇 1.tar -zxvf nexus-latest-bundle.tar.gz 2.cd nexus-2.13.0-01/bin 3../nexus start 这时可能提示 ****************************************WARNING – NOT RECOMMENDED TO RUN AS ROOT****************************************If you insist running as root, then set

安装配置maven私服-nexus

1.ubuntu下的Bundle安装方式 1.1. 去官网下载安装包:http://www.sonatype.org/nexus/ 我这里下载的是:nexus-2.8.1-01-bundle.zip,这个版本需要在jdk7下才能启动 1.2. 解压压缩包: sudo unzip nexus-2.8.1-01-bundle.zip 解压后,我这里是解压到了目录/opt/nexus/下边,在这里可以看到两个目录: nexus-2.8.1-01 和 sonatype-work 1.3. 配置文件: 打

Linux 安装配置maven3.0 以及搭建nexus私服

一.软件准备 1.apache-maven-3.0-bin.tar.gz 下载地址:http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0-bin.tar.gz 2.nexus-oss-webapp-1.8.0-bundle.tar.gz 下载地址:http://nexus.sonatype.org/downloads/ 二.maven安装配置 1.创建需要操作maven的用户组以及用户(如果用root用户安装不用

Linux安装配置maven以及搭建nexus私服

http://nlslzf.iteye.com/blog/812995 一.软件准备 1.apache-maven-3.0-bin.tar.gz 下载地址:http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0-bin.tar.gz 2.nexus-oss-webapp-1.8.0-bundle.tar.gz 下载地址:http://nexus.sonatype.org/downloads/ 二.maven安装配置