如何更改Maven主目录? [英] How to change maven home directory?
本文介绍了如何更改Maven主目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的maven主目录如下,
I have maven home directory as below,
[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主目录更改为其他文件夹,如何通过命令提示符来做到这一点?
Now I want to change the Maven home directory to some other folder, how could I do this through command prompt?
推荐答案
我假设您熟悉操作系统的基础知识.
I assume you are familiar with basics of your OS.
- 转到 Maven下载页面并获取最新版本
- 将其提取到您选择的目录中(
/opt
或/usr/local
或...) - 在
.bashrc
中设置并导出环境变量MAVEN_HOME - 通过$ MAVEN_HOME/bin扩展和导出环境变量PATH
- go to Maven download page and get the latest version
- extract it in a directory of your choice (
/opt
or/usr/local
or ...) - set and export the environment variable MAVEN_HOME in your
.bashrc
- extend and export the environment variable PATH by $MAVEN_HOME/bin
这篇关于如何更改Maven主目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文