centos7 maven nexus3.13.0搭建安装、部署、配置

2018年9月1号 周六 我在加班

    其实公司服务器上的nexus已经装好了,装了两个版本,2.14.3和3.13.0,2.14.3是以前同事装的,各种问题不断,然后我就给装了个3.13.0,但是一直放在那没动,也没启用,今天看2.14.3不爽,给换到3.13.0了,具体安装步骤如下:

服务器是centos7版本,jdk是1.8

1、安装JDK:

yum install -y java
java -version

等待安装完成,如果已经安装,则忽略,如果版本太低,先删除再用yum安装

2、安装maven

yum install -y maven
mvn -v

3、安装nexus

    3.1 下载nexus-3.13.0-01-unix.tar.gz

    上传到服务器

    官网链接地址: https://www.sonatype.com/download-oss-sonatype 下载 linux 最新版本。

3.2解压

 tar -zxvf nexus-3.13.0-01-unix.tar.gz -C /usr/local/

3.3启动

/usr/local/nexus-3.13.0-01/bin
./nexus start

    稍等一会 (首次启动会比较慢), 当出现以下日志的时候表示启动成功! 
    ------------------------------------------------- 
    Starting nexus
    ------------------------------------------------- 

    查看状态

./nexus status

nexus is running.表示已启动

3.4关闭防火墙或者开放防火墙端口,如果是云服务器,需要开启安全组(比如登录腾讯云-->控制台-->安全组)

    关闭防火墙 

service firewalld stop

开放防火墙端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

--permanent永久生效,没有此参数重启后失效

4、访问

nexus默认端口是7037,默认帐号密码是admin/admin123,用此帐号登入进行配置

nexus管理端使用教程请去百度搜索。

5、maven pom配置

    在pom中引入如下配置

<distributionManagement>
		<repository>
    		<id>nexus</id>
    		<url>http://192.168.205.125:7037/repository/maven-releases/</url>
 		</repository>
		<snapshotRepository>
			<id>nexus</id>
			<url>http://192.168.205.125:7037/repository/maven-snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

在maven setting.xml中配置nexus账号密码

<server>   
		<id>nexus</id>   
		<username>admin</username>
		<password>admin123</password>   
	</server>

在项目根目录shift+鼠标右击打开命令窗口执行命令上传包

mvn deploy

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值