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/

  1. 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

【运维技术】Nexus私服安装配置常用问题的更多相关文章

  1. saltstack自动化运维系列⑥SaltStack实践安装配置HAproxy的Keepalived

    saltstack自动化运维系列⑥SaltStack实践安装配置HAproxy的Keepalived 安装配置Keepalived 1.编写功能模块 #创建keepalived目录# mkdir -p ...

  2. saltstack自动化运维系列⑥SaltStack实践安装配置HAproxy

    saltstack自动化运维系列⑥SaltStack实践安装配置HAproxy 下载haproxy1.6.2.tar.gz下载地址:http://www.haproxy.org/download/1. ...

  3. 9.Nexus私服安装配置

    第一步:下载nexus-webapp-1.9.2.4.war包,然后复制到tomcat下的webapps文件夹中 第二步:启动tomcat 第三步:訪问http://localhost:8080/ne ...

  4. 自动化运维工具-mussh工具安装配置及简单使用讲解

    1.先决条件: 安装pssh工具的主机针对远程主机需要配置免秘钥认证: ssh-keygen -t rsa ssh-copy-id [remotehost] 2.下载mussh工具安装介质: http ...

  5. 自动化运维工具-pdsh工具安装配置及简单使用讲解

    1.先决条件: 安装pssh工具的主机针对远程主机需要配置免秘钥认证: ssh-keygen -t rsa ssh-copy-id [remotehost] 2.下载pssh工具安装介质: https ...

  6. 自动化运维工具-pssh工具安装配置及简单使用讲解

    1.先决条件:安装pssh工具要求python版本大于2.4即可. 安装pssh工具的主机针对远程主机需要配置免秘钥认证: ssh-keygen -t rsa ssh-copy-id [remoteh ...

  7. 【运维技术】Nginx安装教程(yum安装,源码编译)

    安装方式 yum直接更新源安装 源码直接编译之后安装 使用yum进行直接安装 Installing a Prebuilt CentOS/RHEL Package from an OS Reposito ...

  8. 【运维技术】windows安装apache服务器,实现域名对应端口的解析跳转

    linux 安装参考搭建dede项目的功能 windows 安装虚拟机的指南参考:http://jingyan.baidu.com/article/29697b912f6539ab20de3cf8.h ...

  9. 端口映射工具 redir/socat/xinetd - 运维技术 - 开源中国社区

    端口映射工具 redir/socat/xinetd - 运维技术 - 开源中国社区 端口映射工具 redir/socat/xinetd    10人收藏此文章, 我要收藏 发表于3天前(2013-08 ...

随机推荐

  1. OpenCV Cut Image via ROI 根据兴趣区域剪裁图片

    我们在使用OpenCV时,有时候需要对现有图片剪裁,比如只需要一个小窗口中的内容,那么我们可以通过OpenCV的兴趣区域 Region of Interest (ROI) 来很轻易的实现,操作也很简单 ...

  2. Python 重定向获取真实url

    通常的返回url: http_headers = { 'Accept': '*/*','Connection': 'keep-alive', 'User-Agent': 'Mozilla/5.0 (W ...

  3. 1.1Tensorflow训练线性回归模型入门程序

    tensorflow #-*- coding: utf-8 -*- # @Time : 2017/12/19 14:36 # @Author : Z # @Email : S # @File : 1. ...

  4. UESTC - 1057 秋实大哥与花 线段树模板题

    http://acm.uestc.edu.cn/#/problem/show/1057 题意:给你n个数,q次操作,每次在l,r上加上x并输出此区间的sum 题解:线段树模板, #define _CR ...

  5. 双节点weblogic集群安装

    一.准备工作 1.环境信息规划 Server name Ip地址 Port 备注 AdminServer 192.168.100.175 7001 管理服务器 Ms1 192.168.100.175 ...

  6. 一句替换bbcode

    $message=preg_replace('/\[[^\[\]]{1,}\]/','',$message);

  7. LightOj 1248 - Dice (III)(几何分布+期望)

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1248 题意:有一个 n 面的骰子,问至少看到所有的面一次的所需 掷骰子 的 次数的期望 ...

  8. html 1:1比例显示

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale= ...

  9. sql server中的日期详解使用(convert)

    转自:http://blog.csdn.net/hehe520347/article/details/48496853 有个字段值例如2012-07-02 00:00:00.000 转化成 2012- ...

  10. /etc/rc.d/rc.local 自定义开机启动程序

    /etc/rc.d/rc.local 用于用户自定义开机启动程序,可以往里写开机要执行的命令或脚本,线上的配置如下: [root@localhost ~]$ cat /etc/rc.d/rc.loca ...