CentOS 7java
JDK:1.8 linux
Maven:3.3.9apache
Nexus:3.11vim
私服是指私有服務器,是架設在局域網的一種特殊的遠程倉庫,目的是代理遠程倉庫及部署第三方構建。有了私服以後,當 Maven 須要下載構件時,直接請求私服,私服上存在則下載到本地倉庫;不然,私服請求外部的遠程倉庫,將構件下載到私服,再提供給本地倉庫下載瀏覽器
http://maven.apache.org/download.cgi服務器
能夠參考個人這篇博客: http://www.javashuo.com/article/p-uekloohu-et.htmljvm
[root@localhost ~]# cd /usr/local/src/ [root@localhost src]# wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz [root@localhost src]# tar -zxvf apache-maven-3.3.9-bin.tar.gz [root@localhost src]# mv apache-maven-3.3.9 /usr/local/maven
編輯/etc/profile文件,在底部添加以下內容:maven
[root@localhost jvm]# vim /etc/profile export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin export MAVEN_HOME=/usr/local/maven export PATH=$PATH:$MAVEN_HOME/bin [root@localhost jvm]# source /etc/profile
4. 驗證是否安裝成功
tcp
[root@localhost jvm]# mvn --version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00) Maven home: /usr/local/maven Java version: 1.8.0_161, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-693.el7.x86_64", arch: "amd64", family: "unix"
https://www.sonatype.com/download-oss-sonatypespa
[root@localhost jvm]# cd /usr/local/src/ [root@localhost src]# wget https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.11.0-01-unix.tar.gz [root@localhost src]# tar -zxvf nexus-3.11.0-01-unix.tar.gz [root@localhost src]# mv nexus-3.11.0-01 /usr/local/nexus
默認端口8081,若是要修改端口能夠在etc/nexus-default.properties配置中修改
啓動:
[root@localhost src]# /usr/local/nexus/bin/nexus start WARNING: ************************************************************ WARNING: Detected execution as "root" user. This is NOT recommended! WARNING: ************************************************************ Starting nexus
上面在啓動過程當中出現警告:不推薦使用root用戶啓動,創個新用戶就行。這個警告不影響nexus的正常訪問和使用。
能夠參考我這篇博客:http://www.javashuo.com/article/p-xvzjvlcj-dt.html
[root@localhost src]# firewall-cmd --add-port=8081/tcp --permanent success [root@localhost src]# firewall-cmd --reload success
這就把nexus服務搭建好了,默認管理員帳號密碼是admin/admin123