Linux-Maven部署

Posted dingkailinux

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux-Maven部署相关的知识,希望对你有一定的参考价值。

一、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部署的主要内容,如果未能解决你的问题,请参考以下文章

导出eclipse可部署插件和片段时出错

react简介

react简介

Gitlab代码管理仓库安装部署

GitLab安装部署

持续集成与自动化部署 - gitlab部署