Ubuntu16.04 maven的安装和配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weiganliu/article/details/83089347

一 下载maven

apache maven官网地址:http://maven.apache.org/download.cgi

二、安装配置maven

解压maven:

$ sudo mkdir /opt/maven
$ sudo tar zxvf apache-maven-3.5.4-bin.tar.gz -C /opt/maven

三、配置mavne环境

sudo vim /etc/profile

export M2_HOME=/opt/maven/apache-maven-3.5.0
export CLASSPATH=$CLASSPATH:$M2_HOME/lib
export PATH=$PATH:$M2_HOME/bin

运行使配置文件生效。

source /etc/profile

验证

mvn -v

出现以下,表示成功。

Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /opt/maven/apache-maven-3.5.4
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-34-generic", arch: "amd64", family: "unix"

展开阅读全文

没有更多推荐了,返回首页