1、先安装maven
官网 https://maven.apache.org/download.cgi
2、下载方式
(1) 先去官网下载
查看以前maven的地址:
https://archive.apache.org/dist/maven/maven-3
直接wget安装
wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
(2)直接下载本地,然后上传到服务器
(3)解压 tar -zxvf apache-maven-3.8.6-bin.tar.gz
[root@localhost src]# vim /etc/profile
#set for maven
export M2_HOME=/opt/maven/apache-maven-3.8.6
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
配置立即生效
source /etc/profile
查看是否安装成功
3、安装nexus
下载地址:https://www.sonatype.com/nexus-repository-oss
(1)下载
[root@localhost src]# wget https://sonatype-download.global.ssl.fastly.net/nexus/3/latest-unix.tar.gz
[root@localhost src]# tar xf nexus-3.15.2-01-unix.tar.gz
[root@localhost src]# vim /etc/profile
#set for nexus
export NEXUS_HOME=/opt/nexus/nexus-3.38.0-01
export PATH=$PATH:$NEXUS_HOME/bin
[root@localhost src]# source /etc/profile
启动和停止
访问地址:http://ip:8081,可在这里配置
注意,第一次输入密码需要在该目录下找
3、把项目中的依赖上传到私服
(1)首页要在本地maven中的setting配置 账号密码
(2)项目上配置
在pom文件配置
然后点部署
上传成功。
(3)若需要在本地上传jar包到nexus