- 安装jdk
- 安装maven
tar -zxvf apache-maven-3.6.0-bin.tar.gz
vi /etc/profile
export MAVEN_HOME=/home/apache-maven-3.6.0 export PATH=$MAVEN_HOME/bin:$PATH
source /etc/profile
mvn -v - 安装nexus
下载unix版本https://www.sonatype.com/download-oss-sonatype
tar -zxvf nexus-3.15.2-01-unix.tar.gz
#授权
chmod a+x / /home/nexus-3.15.2-01/bin/*
#启动
/home/nexus-3.15.2-01/bin/nexus start
#关闭
/home/nexus-3.15.2-01/bin/nexus stop
#查看是否启动
/home/nexus-3.15.2-01/bin/nexus console
#可修改配置文件,端口,ip等,ip必须为本机ip否则无法使用
vi /home/nexus-3.15.2-01/etc/nexus-default.properties
application-port=8888
application-host=192.168.1.101
nexus-context-path=/nexus
#验证是否正常
http://192.168.1.101:8888/nexus/
默认账户admin/admin123 - 创建maven仓库
最上方设置/Repostory/Repositories/Create repository
maven2(hosted)
Hosted选择Allow redepoly
说明
maven2(proxy):远程仓库的代理,本地找,找不少上远程仓库下载
maven2(hosted):宿主仓库,手动上传
maven2(group):仓库组,不需要配置多个pom的地址,需要group自行配置,注意缓存
Centos7使用nexus搭建maven仓库
最新推荐文章于 2024-09-10 17:26:45 发布