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 安装运维手册的更多相关文章

  1. 使用ansible编译安装运维工具tmux

    实验系统:CentOS 6.6_x86_64 实验前提:提前准备好编译环境,防火墙和selinux都关闭 软件介绍:tmux是一个优秀的终端复用软件,类似GNU Screen,但来自于OpenBSD, ...

  2. 最全的linux命令大全,shell运维手册

    shell实例手册 0 说明{ 手册制作: 雪松} 1 文件{        ls -rtl                 # 按时间倒叙列出所有目录和文件 ll -rt    touch file ...

  3. [转帖]Shell运维手册

    shell实例手册    https://github.com/liquanzhou/ops_doc   0 说明{       手册制作: 雪松   更新日期: 2018-09-11       欢 ...

  4. redis 运维手册

    redis cli命令 - milkty - 博客园https://www.cnblogs.com/kongzhongqijing/p/6867960.html Redis多个数据库 - EasonJ ...

  5. Hbase运维手册(1)

    1. region情况 需要检查 1. region的数量(总数和每台regionserver上的region数) 2. region的大小 如果发现异常可以通过手动merge region和手动分配 ...

  6. VERITAS NETBACKUP运维手册(自制)

    ps:本文为目录.详情请点如下目录超链接 1 VERITAS NETBACKUP介绍 1.1 NBU基本概念 1.2 配置存储单元 1.3 配置备份策略(Policy) 1.4 配置NetBackup ...

  7. redis运维手册

    版本采用:redis-3.2.11.tar.gz 官网下载地址:https://redis.io/download 1.redis服务器资源 redis服务器基础配置CPU2核.内存按需分配,系统磁盘 ...

  8. 命令行界面下使用emca安装配置Oracle Database Control实战

    作为命令行忠有用户,server端软件的运维都倾向于使用命令或 脚本完毕,非常讨厌资源占用非常大的GUI.Oracle数据库作为重要的server端软件.其安装运维自然也全然支持纯命令行方式.虽然同一 ...

  9. 2019阿里云开年Hi购季基础云产品分会场全攻略!

    2019阿里云云上Hi购季活动已经于2月25日正式开启,从已开放的活动页面来看,活动分为三个阶段: 2月25日-3月04日的活动报名阶段.3月04日-3月16日的新购满返+5折抢购阶段.3月16日-3 ...

随机推荐

  1. vue基础中的注意事项,以及一些学习心得

    vue中你不知道的东西.以及注意事项 v-html 使用 v-html的时候该指令中的值会覆盖绑定标签中原有的值,且使用v-html的时候不要将他设置为给用户提供内容的地方,因为v-html很容易被X ...

  2. git 删除和复制远程分支 储藏

    不常用到命令经常查,特别记录,方便自己开箱即用. 1. 删除本地分支 git branch -D <dev> 2. 删除远程分支 git push origin --delete < ...

  3. 本地Git绑定Gitee仓库

    前言 Window的小伙伴如果还没在本地配好Git环境可以参考:https://www.cnblogs.com/poloyy/p/12185132.html 创建Gitee仓库 Gitee绑定本地Gi ...

  4. 一文带你看清HTTP所有概念

    上一篇文章我们大致讲解了一下 HTTP 的基本特征和使用,大家反响很不错,那么本篇文章我们就来深究一下 HTTP 的特性.我们接着上篇文章没有说完的 HTTP 标头继续来介绍(此篇文章会介绍所有标头的 ...

  5. GitHub高级搜索指南

    还在为自学时找不到适合练手的项目而苦恼? 还在好奇别人是如何在GitHub众多项目中找到高质量代码的? 真的是因为他们独具慧眼吗? 不,其实他们只是掌握了正确的搜索方法. 下面介绍几种常用的GitHu ...

  6. 西柚考勤系统——alpha2

    这个作业属于哪个课程 http://edu.cnblogs.com/campus/xnsy/GeographicInformationScience 这个作业的要求在哪里 https://www.cn ...

  7. MD5加密解密以及设置salt(盐值)

    MD5算法 package com.oracle.jsp.util; import java.security.MessageDigest; import java.security.NoSuchAl ...

  8. Druid入门(1)—— 快速入门实时分析利器-Druid_0.17

    一.安装准备 本次安装的版本是截止2020.1.30最新的版本0.17.0 软件要求 需要Java 8(8u92 +)以上的版本,否则会有问题 Linux,Mac OS X或其他类似Unix的操作系统 ...

  9. SpringBoot之切面AOP

    SpringBoot提供了强大AOP支持,我们前面讲解过AOP面向切面,所以这里具体AOP原理就补具体介绍: AOP切面主要是切方法,我们一般搞一些日志分析和事务操作,要用到切面,类似拦截器: @As ...

  10. FFMPEG学习----使用SDL播放YUV数据

    命令行下配置: G:\Coding\Video\SDL\proj>tree /F 文件夹 PATH 列表 卷序列号为 0FD5-0CC8 G:. │ sdl.cpp │ SDL2.dll │ S ...