是否可以在不设置环境变量的情况下使用Maven? [英] Can I use Maven without setting the Environment variable?
问题描述
我想在项目中使用Maven.
I want to use Maven for my project.
在我的办公室计算机中,我没有Admin特权.因此,我无法设置系统变量". 我只能访问用户变量",在其中只能设置Java_Home.
In my office computer , I don't have the Admin privilege . Hence I am not able to set the "System Variable". I have access only to "User Variable" where I can set only the Java_Home.
我可以使用 Maven 而不添加 M2_Home 并编辑 Path 变量吗?
Can I use Maven without adding the M2_Home and editing the Path variable ?
推荐答案
这取决于您是在IDE中使用它还是在终端中构建项目.
It depends if you are using it inside an ide or building project from terminal.
- 如果使用的是IDE,则可能有一个嵌入式Maven(Eclipse和Intellij IDEA中有一个).
-
如果使用CLI进行构建,则可以使用完整路径来调用maven. 例如:
- If you are using an IDE, there is probably an embedded maven ( there is one inside Eclipse and Intellij IDEA)
If you are building using CLI you can invoke maven using the full path for instance :
/home/<your_folder>/tools/apache-maven-3.5.0/bin/mvn clean install
这篇关于是否可以在不设置环境变量的情况下使用Maven?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!