M2_HOME和MAVEN_HOME有什么区别 [英] What is the difference between M2_HOME and MAVEN_HOME

查看:648
本文介绍了M2_HOME和MAVEN_HOME有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个版本的maven home环境变量-M2_HOMEMAVEN_HOME.

I have two version of environment variables for maven home - M2_HOME and MAVEN_HOME.

需要设置哪个?

推荐答案

MAVEN_HOME适用于Maven 1,M2_HOME适用于Maven 2及更高版本.

MAVEN_HOME is for Maven 1, M2_HOME is for Maven 2 and later.

Maven 2是对Maven 1的完全重写,并且不向后兼容.拥有两个不同的_HOME变量意味着可以在同一台计算机上同时运行这两个变量.

Maven 2 was a complete rewrite from Maven 1 and was not backwards compatible. Having the two different _HOME variables means it is possible to run both on the same machine.

更新

从maven 3.5.0开始,这些环境变量都不应该指定.相反,应该更新路径以包含mvn可执行文件.

As of maven 3.5.0 neither of these environment variables should be specified. Instead, the path should be updated to include the mvn executable.

这篇关于M2_HOME和MAVEN_HOME有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆