从零开始搭建系统2.1——Nexus安装及配置
在安装配置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端口
添加
5.验证是否启动成功
http://192.168.0.200:8081
出现上述页面,说明配置nexus成功!
点击右上角“Log in”, 输入用户名和密码(默认用户名:admin 密码: admin123)登录。
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安装及配置的更多相关文章
- 从零开始搭建系统2.8——HDFS安装及配置
从零开始搭建系统2.8——HDFS安装及配置
- 从零开始搭建系统2.4——Jenkins安装及配置
1.安装wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins.io/redhat-stable/jenkins.reporpm --impo ...
- 从零开始搭建系统2.2——ELK安装及配置
ELK 最新版本对JDK的最低要求是1.8,安装java_1.8版本 一.Elasticsearch 1.创建目录 2.下载安装包 wget https://artifacts.elastic.co/ ...
- 从零开始搭建系统1.7——FTP安装及配置
1.安装vsftp软件包 [root@localhost usr]# yum install -y vsftpd 2.先备份vsftpd的默认配置文件 [root@localhost usr]# cd ...
- 从零开始搭建系统1.3——Tomcat安装及配置
首先安装jdk,手动解压JDK的压缩包,然后设置环境变量 1.卸载自带openjdk 查询OpenJDK rpm -qa|grep java 批量卸载所有名字包含jdk的已安装程序.命令行: rpm ...
- 从零开始搭建系统1.2——Nginx安装及配置
一.安装准备 首先由于nginx的一些模块依赖一些lib库,所以在安装nginx之前,必须先安装这些lib库,这些依赖库主要有g++.gcc.openssl-devel.pcre-devel和zlib ...
- 从零开始搭建系统2.5——Apollo安装及配置
参见https://github.com/ctripcorp/apollo/wiki/Quick-Start安装即可
- 从零开始搭建系统1.4——MySql安装及配置
安装环境:CentOS7 64位 ,安装MySQL5.7 1.创建mysql目录 2.在MySQL官网中下载YUM源rpm安装包:http://dev.mysql.com/downloads/repo ...
- 从零开始搭建系统1.5——Redis安装及配置
1.在/usr/目录下创建redis目录 [root@localhost usr]# mkdir redis 2.下载安装包 wget http://download.redis.io/release ...
随机推荐
- HDU 1261 字串数(排列组合)
字串数 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submiss ...
- Python值正则表达式(RE)
要想在Python中使用正则表达式,首先要引入模块: import re . 匹配任意一个 + 匹配至少一个 * 匹配0个至多个 ? 1个或0个(可有可无) - 表范围 \ 转义 ^ 在首 $ ...
- kali linux 2019.4 最新版设置中文 - 开启win10风格界面
最新版 kali linux 2019.4 默认是不带中文字体的,执行以下命令,便可以显示: kali源:vi /etc/apt/source.list #中科大 deb http://mirrors ...
- tinkphp5.0目录结构说明
tinkphp5.0目录结构说明 project 应用部署目录 ├─application 应用目录(可设置) │ ├─common 公共模块目录(可更改) │ ├─index 模块目录(可更改) │ ...
- Git中crlf自动转换的坑
新上手一个项目,克隆了代码下来搭环境,一路坑.其中一个sh脚本执行不了,报IOException,java日志除了"找不到文件或文件夹"之外看不出任何信息,手动运行脚本才发现是脚本 ...
- JAXB读写xml
一.注解 在Java模型中的创建与 xml 文件对应的节点和属性需要用注解来表示 @XmlRootElement 作用:将一个Java类映射为一段XML的根节点参数: name 定义这个根节点 ...
- winpe
winpe winpe winpe 工具 判断是否pe系统的方法:GetSystemDisk()
- Dubbox服务的提供方配置
在src/main/resources下创建applicationContext-service.xml ,内容如下: <?xml version="1.0" encodin ...
- Java优化性能
尽量在合适的场合使用单例使用单例可以减轻加载的负担,缩短加载的时间,提高加载的效率,但并不是所有地方都适用于单例,简单来说,单例主要适用于以下三个方面:第一,控制资源的使用,通过线程同步来控制资源的并 ...
- SQL 循环语句几种写法
1.正常循环语句 declare @orderNum varchar(255)create table #ttableName(id int identity(1,1),Orders varchar( ...