如何更改maven主目录?

时间:2016-01-08 07:30:43

标签: maven installation

我有maven主目录,如下所示,

 [root@localhost configuration-simple]# su -c "vi /etc/profile.d/maven.sh"
 [root@localhost configuration-simple]# mvn -version
 Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530)
  Maven home: /home/kartyk/NetBeansProjects/motown.io/motown-develop/apache-maven-3.0.5
  Java version: 1.7.0_51, vendor: Oracle Corporation
  Java home: /usr/java/jdk1.7.0_51/jre
  Default locale: en_US, platform encoding: UTF-8
  OS name: "linux", version: "3.19.8-100.fc20.x86_64", arch: "amd64",  family: "unix"
[root@localhost configuration-simple]# 

现在我想将Maven主目录更改为其他文件夹,如何通过命令提示符执行此操作?

1 个答案:

答案 0 :(得分:2)

我假设您熟悉操作系统的基础知识。

  1. 转到Maven download page并获取最新版本
  2. 将其解压缩到您选择的目录中(/opt/usr/local或...)
  3. .bashrc
  4. 中设置并导出环境变量MAVEN_HOME
  5. 通过$ MAVEN_HOME / bin
  6. 扩展和导出环境变量PATH