码迷,mamicode.com
首页 > 系统相关 > 详细

Linux-Maven部署

时间:2018-04-11 15:43:22      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:hot   head   src   变量   tools.jar   pre   环境变量   backup   ati   

一、Maven是什么

 

二、Maven部署

1.环境信息:

(1)centos7.3

(2)jdk1.8

(3)maven3.5.3

2.安装jdk

(1)下载地址【http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html】

(2)部署jdk

#cd /usr/local/src/
#wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" ‘http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz‘ #tar -zxf jdk-8u161-linux-x64.tar.gz
#mv jdk1.8.0_161 /usr/local/jdk1.8

(3)配置java变量

#vim /etc/profile
添加以下配置
JAVA_HOME=/usr/local/jdk1.8
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/dt.jar
export JAVA_HOME JRE_HOME PATH CLASSPAT

#source /etc/profile

(4)测试java

# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

3.部署maven

(1)下载地址【https://maven.apache.org/download.cgi】

(2)部署maven

#cd /usr/local/src
#wget http://mirrors.shu.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz
#tar -zxf
#mv apache-maven-3.5.3 /usr/local/mave

(3)配置环境变量

#vim /etc/profile
添加以下配置
MAVEN_HOME=/usr/local/maven
export MAVEN_HOME  
export PATH=${PATH}:${MAVEN_HOME}/bin

#source /etc/profile

(4)测试

# mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: /usr/local/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/local/jdk1.8/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.el7.x86_64", arch: "amd64", family: "unix"

 

Linux-Maven部署

标签:hot   head   src   变量   tools.jar   pre   环境变量   backup   ati   

原文地址:https://www.cnblogs.com/dingkailinux/p/8794611.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!