在安装配置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. [轉]Reverse a singly linked list

    Reverse a singly linked list  http://angelonotes.blogspot.tw/2011/08/reverse-singly-linked-list.html ...

  2. go strconv

    strconv是golang用来做数据类型转换的一个库. 介绍下strconv最常用的两个方法, 没有解释语言那么自在可以str(int),int(string), 那还算简练. num, err : ...

  3. offset 、 client 和 scroll - PC端网页特效

    1.元素偏移量  offset 系列 1.1 offset 就是偏移量,使用 offset 系列相关属性可以 动态 得到该元素的位置(偏移).大小等. 注意: 1.获得元素距离带有定位父元素的位置 2 ...

  4. JS window对象 返回浏览历史中的其他页面 go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面。 语法: window.history.go(number);

    返回浏览历史中的其他页面 go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面. 语法: window.history.go(number); 参数: 浏览器中,返回当前页面 ...

  5. oracle入门学习之oracle数据库结构

    1. oracle数据库结构 1.1 Oracle可以看做是一个大的数据库???,里面可以创建很多实例; 一个实例对应多个表空间.多个用户; 一个用户只能有一个表空间; 一个表空间可以有多个用户; 一 ...

  6. loj2573[TJOI2018]数字计算

    题意:操作1:x=x*m,输出x%mod.2.x/=map[m].m即第m次操作,保证该次操作为1操作,并且每个操作最多只会被删一次.q<=1e5. 线段树维护操作信息的乘积,删除把对应位置的权 ...

  7. Vue学习笔记【22】——Vue中的动画(列表的排序过渡)

    <transition-group> 组件还有一个特殊之处.不仅可以进入和离开动画,还可以改变定位.要使用这个新功能只需了解新增的 v-move 特性,它会在元素的改变定位的过程中应用. ...

  8. 自定义solr域中的配置

    <!-- IKAnalyzer--> <fieldType name="text_ik" class="solr.TextField"> ...

  9. 分布式项目web.xml配置文件的表头

    <?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://w ...

  10. 前缀和+排序——cf1043E

    先不考虑第二个条件 要求i和所有其他人的分数和最小,选择x还是y,可以推出一个公式,即差xi-yi小的j都选y,反之都选x 那么按照xi-yi排序即可 然后再考虑第二个条件,做减法就行 /* xi+y ...