How to change maven home directory?

北慕城南 提交于 2021-02-10 05:52:12

问题


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]# 

Now I want to change the Maven home directory to some other folder, how could I do this through command prompt?


回答1:


I assume you are familiar with basics of your OS.

  1. go to Maven download page and get the latest version
  2. extract it in a directory of your choice (/opt or /usr/local or ...)
  3. set and export the environment variable MAVEN_HOME in your .bashrc
  4. extend and export the environment variable PATH by $MAVEN_HOME/bin


来源:https://stackoverflow.com/questions/34671637/how-to-change-maven-home-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!