在安装配置Nexus时,请先确定您已经配置好jdk

1.创建目录

2.下载安装包

[root@localhost usr]# cd nexus

下载地址:https://www.sonatype.com/download-oss-sonatype

wget https://sonatype-download.global.ssl.fastly.net/repository/repositoryManager/3/nexus-3.9.0-01-unix.tar.gz

3.解压安装包

tar -zxvf nexus-3.9.0-01-unix.tar.gz

解压之后生成两个文件夹,分别为nexus-2.3.1-01、sonatype-work

4.启动

进入到bin目录下,执行./nexus start

解决上面的提示:

创建nexus用户

groupadd nexus#创建组

useradd nexus -g nexus#创建用户并将用户添加到组

#修改文件所有者

chown -R nexus  /usr/nexus/

修改 nexus 脚本,指定启动用户

5.开启8081端口

添加

firewall-cmd --zone=public --add-port=8081/tcp --permanent    (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=8081/tcp
查看所有打开的端口
firewall-cmd --zone=public --list-ports

5.验证是否启动成功

http://192.168.0.200:8081

出现上述页面,说明配置nexus成功!

点击右上角“Log in”, 输入用户名和密码(默认用户名:admin      密码: admin123)登录。

6.开机启动

sudo ln -s /usr/nexus/nexus-3.9.0-01/bin/nexus /etc/init.d/nexus

使用
service nexus status/start/stop
查看nexus服务状态、启动服务、停止服务等

使用
chkconfig nexus on/off

设置nexus服务开机自启动或者开机不启动

如果启动不起来的话可以用下面方式启动,通过启动日志查找问题

service nexus start-launchd

7.配置nexus

新建store

8.proxy私仓,使用的外部私仓是阿里的仓库http://maven.aliyun.com/nexus/content/groups/public:

9.release私仓

10.snapshot私仓

11.group私仓组

12.如何在项目中使用

settings.xml 配置

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<localRepository>D:\.m2\repository</localRepository>

<pluginGroups>
<pluginGroup>org.sonatype.plugins</pluginGroup>
</pluginGroups>

<proxies>
</proxies>

<servers>
<server>
<id>Releases</id>
<username>admin</username>
<password>admin123</password>
</server>

<server>
<id>Snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>

<mirrors>

<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://192.168.0.200:8081/repository/nexus-public/</url>
</mirror>
</mirrors>

<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>

</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>

项目pom配置

<distributionManagement>
<repository>
<id>Releases</id>
<name>Releases</name>
<url>http://192.168.0.200:8081/repository/nexus-releases</url>
</repository>
<snapshotRepository>
<id>Snapshots</id>
<name>Snapshots</name>
<url>http://192.168.0.200:8081/repository/nexus-snapshots</url>
</snapshotRepository>
</distributionManagement>

 

13.直接deploy即可

14.设置可重复deploy

如果需要可重复deploy同一个版本的jar包,可进行如下配置

从零开始搭建系统2.1——Nexus安装及配置的更多相关文章

  1. 从零开始搭建系统2.8——HDFS安装及配置

    从零开始搭建系统2.8——HDFS安装及配置

  2. 从零开始搭建系统2.4——Jenkins安装及配置

    1.安装wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.reporpm --impo ...

  3. 从零开始搭建系统2.2——ELK安装及配置

    ELK 最新版本对JDK的最低要求是1.8,安装java_1.8版本 一.Elasticsearch 1.创建目录 2.下载安装包 wget https://artifacts.elastic.co/ ...

  4. 从零开始搭建系统1.7——FTP安装及配置

    1.安装vsftp软件包 [root@localhost usr]# yum install -y vsftpd 2.先备份vsftpd的默认配置文件 [root@localhost usr]# cd ...

  5. 从零开始搭建系统1.3——Tomcat安装及配置

    首先安装jdk,手动解压JDK的压缩包,然后设置环境变量 1.卸载自带openjdk 查询OpenJDK rpm -qa|grep java 批量卸载所有名字包含jdk的已安装程序.命令行: rpm  ...

  6. 从零开始搭建系统1.2——Nginx安装及配置

    一.安装准备 首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.openssl-devel.pcre-devel和zlib ...

  7. 从零开始搭建系统2.5——Apollo安装及配置

    参见https://github.com/ctripcorp/apollo/wiki/Quick-Start安装即可

  8. 从零开始搭建系统1.4——MySql安装及配置

    安装环境:CentOS7 64位 ,安装MySQL5.7 1.创建mysql目录 2.在MySQL官网中下载YUM源rpm安装包:http://dev.mysql.com/downloads/repo ...

  9. 从零开始搭建系统1.5——Redis安装及配置

    1.在/usr/目录下创建redis目录 [root@localhost usr]# mkdir redis 2.下载安装包 wget http://download.redis.io/release ...

随机推荐

  1. tomcat+nginx 单机部署多应用LINUX

    1.首先虚拟机上安装nginx 和tomcat,这里安装就不赘述了. nginx安装可以参考https://www.linuxidc.com/Linux/2016-09/134907.htm,相关配置 ...

  2. android中的BroadCastReceiver

    BroadCastReceiver组件本质是一种全局的监听器,用于监听系统全局的广播消息.由于BroadCastReceiver是一种全局的监听器,因此他可以非常方便的实现系统之间不同组件之间的通信. ...

  3. this 的指向问题

    1.全局作用域或者普通函数中 this 指向全局对象 window ( 定时器里面的this 指向 window ) 1.1 console.log(this); // window 1.2 func ...

  4. 出现异常: 非介入式客户端验证规则中的验证类型名称必须唯一。下列验证类型出现重复: required

    在将web.config文件中的<add key="ClientValidationEnabled" value="false" /> 设为fals ...

  5. C#5.0 异步编程 Async和Await--理解异步方法与线程之间的关系

    这次来理解一下异步方法与线程之间的关系 新建一个控制台程序 代码如下 static void Main(string[] args) { Console.WriteLine("\n进入Mai ...

  6. 【记录】gitLab git命令add commit fetch pull push

    最近项目使用git进行版本控制,由于之前用svn,所以对git不是太熟悉,网上一通乱找git各命令含义, 以下内容感觉讲的很详细,可以很清楚理解git提交流程,博主把重要的信息用红字标注了,更加显眼. ...

  7. linux常用命令-1系统相关命令

    hostname #计算机名 passwd #修改密码 reboot #重启 shutdown –r now #立刻重启(root用户使用) shutdown –r 10 #过10分钟自动重启(roo ...

  8. [python3]未配置locale的主机出现UnicodeDecodeError: 'ascii' codec can't decode byte 0x....的解决

    之前写的发邮件的程序部署到vps的时候出现了 UnicodeDecodeError: 'ascii' codec can't decode byte 0x.... 的错误. 按理说UnicodeDec ...

  9. Grep的过滤使用

    grep的过滤使用 已知文件test里有以下内容 [root@yangwenbo /]# cat test yuni yunwei YUNWEI YWEI yunjijsuan yunsuan YUN ...

  10. Codeforces 1150D DP

    题意:给你一个长度为n的字符串,有q次询问,每次询问会给字符串x的末尾添加一个字符y,或者删除字符串x末尾的字符,询问过后,要判断长度为n的字符串中是否有3个不重合的子序列,是这3个字符串. 思路:设 ...