Nexus 安装运维手册
1. Nexus 安装与配置
1.1 下载Nexus
登录https://www.sonatype.com/download-oss-sonatype,下载最新的Nexus版本。 我这里使用的是nexus-3.16.1-02版本;
1.2 安装Nexus
#将tar包上传到服务器/usr/local/目录下解压,这个时候会出现 nexus-3.16.1-02、sonatype-work 两个文件夹 tar -zxvf nexus-3.16.1-02-unix.tar.gz #修改配置文件,eg:端口号 cd /usr/local/nexus-3.16.1-02/etc vim nexus-default.properties
1.3 启动Nexus
启动用户是root的时候会出现下面的警告,可以通过修改/usr/local/nexus-3.16.1-02/bin/nexus.rc文件解决;

#修改启动用户run_as_user,建议不要使用root vim /usr/local/nexus-3.16.1-02/bin/nexus.rc #
cd /usr/local/nexus-3.16.1-02/bin ./nexus start --后台启动 ./nexus run --前台启动,显示日志
1.4 登录Nexus
服务启动完以后,输入Ip地址+端口访问(8081),Nexus默认的账户名和密码是是 admin/admin123

1.5 配置私有库
将私有库添加到http://192.168.209.128:8081/repository/maven-public/中。



1.6 导入jar包
一般私服都是存在内网环境,Nexus3.0以后需要通过命令命令将具体的jar包打到私服中;
#将下面的脚本丢到需要上传jar包的文件目录下
chmod u+x mavenimport.sh
./mavenimport.sh -u admin -p admin123 -r http://192.168.209.128:8081/repository/lingan/
#!/bin/bash
# copy and run this script to the root of the repository directory containing files
# this script attempts to exclude uploading itself explicitly so the script name is important
# Get command line params while getopts ":r:u:p:" opt; do
case $opt in
r) REPO_URL="$OPTARG"
;;
u) USERNAME="$OPTARG"
;;
p) PASSWORD="$OPTARG"
;;
esac
done find . -type f -not -path './mavenimport\.sh*' -not -path '*/\.*' -not -path '*/\^archetype\-catalog\.xml*' -not -path '*/\^maven\-metadata\-local*\.xml'
-not -path '*/\^maven\-metadata\-deployment*\.xml' | sed "s|^\./||" | xargs -I '{}' curl -u "$USERNAME:$PASSWORD" -X PUT -v -T {} ${REPO_URL}/{} ;
1.7 设置登录用户权限
建议将admin注销,重新定义一个登录用户。在Nexus 3.0 这个版本中我直接删除admin会报错,但是设置为不可用没有问题;

2. Maven 安装与配置
2.1 下载Maven
登录http://maven.apache.org 下载最新的maven版本,我这里使用的是apache-maven-3.6.1版本。
2.2 安装Maven
将tar包上传到服务器/usr/local/目录下解压
tar -zxvf apache-maven-3.6.1-bin.tar.gz
2.3 配置Maven
#配置release、snapshot的用户信息;
#配置mirror指向私服的nexus-public;
vim /usr/local/maven/apache-maven-3.6.1/conf/setting.xml
3. 工作空间配置
3.1 修改本地Maven配置
配置release、snapshot的用户信息;
配置mirror指向私服的nexus-public;
3.2 修改工程中的pom文件
<repositories>
<repository>
<id>nexus-public</id>
<url>http://192.168.11.23:8180/repository/maven-public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>release</id>
<url>http://192.168.11.23:8180/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshot</id>
<url>http://192.168.11.23:8180/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
</plugins>
</build>
Nexus 安装运维手册的更多相关文章
- 使用ansible编译安装运维工具tmux
实验系统:CentOS 6.6_x86_64 实验前提:提前准备好编译环境,防火墙和selinux都关闭 软件介绍:tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD, ...
- 最全的linux命令大全,shell运维手册
shell实例手册 0 说明{ 手册制作: 雪松} 1 文件{ ls -rtl # 按时间倒叙列出所有目录和文件 ll -rt touch file ...
- [转帖]Shell运维手册
shell实例手册 https://github.com/liquanzhou/ops_doc 0 说明{ 手册制作: 雪松 更新日期: 2018-09-11 欢 ...
- redis 运维手册
redis cli命令 - milkty - 博客园https://www.cnblogs.com/kongzhongqijing/p/6867960.html Redis多个数据库 - EasonJ ...
- Hbase运维手册(1)
1. region情况 需要检查 1. region的数量(总数和每台regionserver上的region数) 2. region的大小 如果发现异常可以通过手动merge region和手动分配 ...
- VERITAS NETBACKUP运维手册(自制)
ps:本文为目录.详情请点如下目录超链接 1 VERITAS NETBACKUP介绍 1.1 NBU基本概念 1.2 配置存储单元 1.3 配置备份策略(Policy) 1.4 配置NetBackup ...
- redis运维手册
版本采用:redis-3.2.11.tar.gz 官网下载地址:https://redis.io/download 1.redis服务器资源 redis服务器基础配置CPU2核.内存按需分配,系统磁盘 ...
- 命令行界面下使用emca安装配置Oracle Database Control实战
作为命令行忠有用户,server端软件的运维都倾向于使用命令或 脚本完毕,非常讨厌资源占用非常大的GUI.Oracle数据库作为重要的server端软件.其安装运维自然也全然支持纯命令行方式.虽然同一 ...
- 2019阿里云开年Hi购季基础云产品分会场全攻略!
2019阿里云云上Hi购季活动已经于2月25日正式开启,从已开放的活动页面来看,活动分为三个阶段: 2月25日-3月04日的活动报名阶段.3月04日-3月16日的新购满返+5折抢购阶段.3月16日-3 ...
随机推荐
- ubuntu下打开html页面
相信遇到这个问题的各位都是闲人,所以肯定是有时间的,网上打开html教程很多,但是就不吐槽了emmm... 详细信息不在此篇幅,网络资源,我就不重复了,看着很烦的,见附录 下面进入正题 这个配置玩过的 ...
- border-radius属性失效了Ծ‸Ծ
.btn-circle { width: 30px; height: 30px; text-align: center; padding: 4px ; font-size: 16px; font-we ...
- java 语句流程
一.if条件判断 太简单,不加说明 二.switch条件选择语句 注意: 1.switch(表达式),表达式的数据类型 byte/short/char/int/String/enum 2.别忘记写br ...
- 基于七牛云对象存储,搭建一个自己专属的极简Web图床应用(手摸手的注释讲解核心部分的实现原理)
一个极简的Web图床应用,支持复制粘贴与拖拽上传图片 1.开发缘由 日常使用Vs Code编写markdown笔记与博客文章时,在文章中插入图片时发现非常不便 使用本地文件编写相对路径---没法直接复 ...
- 技术交流群和CSDN免费下载服务
1.最近很多新读者的关注,如果还没认识我或不清楚本公号能为你带来什么,可点击阅读你.我 2.本篇文章只为告诉新读者与不知道这些福利的旧读者 本公号其中为你提供的两大价值之处: 一个好的学习环境:技术交 ...
- java异步调用方法
一.利用多线程 直接new线程 Thread t = new Thread(){ @Override public void run() { longTimeMethod(); } }; 使用线程池 ...
- 创建自定义路由处理程序(Creating a Custom Route Handler) | 定制路由系统| 高级路由特性 |精通ASP-NET-MVC-5-弗瑞曼
自定义实现 IRouteHandler
- 创建dynamics CRM client-side (十二) - HTML Web Resource
HTML Web Resource是我们经常使用的一个功能. 第一步, 我们先创建好一个HTML. 接下来,我们要在web resource中创建新的html web resource. 我们在tex ...
- Java8 Stream用法详解
1.概述 Stream 的原理:将要处理的元素看做一种流,流在管道中传输,并且可以在管道的节点上处理,包括过滤筛选.去重.排序.聚合等.元素流在管道中经过中间操作的处理,最后由最终操作得到前面处理的结 ...
- lareval 快速搭建管理后台
一.环境及软件 window X64 phpstudy_x64_8.1.0.1.exe 集成环境 下载地址 https://www.xp.cn/ Nginx1.15.11 MySQL5.7.26 PH ...