eclipse 在eclipse中在哪里编写maven命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4924959/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
where to write maven commands in eclipse
提问by Nishant
I have seen on internet to run command like
我在互联网上看到运行命令
mvn . . . . . something
but I am confused where to write this.
但我很困惑在哪里写这个。
if in command prompt cmd.exe
如果在命令提示符 cmd.exe
I tried mvn.exe it says command not found
我试过 mvn.exe 它说找不到命令
because maven is in STS
因为 maven 在 STS 中
回答by Nishant
Hope you have m2eclipse installed.
希望你安装了 m2eclipse。
Right click on project directory in Eclipse > Run As > Run Configurations... > Double click Maven Build > fill in name, select base directory of the project, provide goal (e.g. clean install), provide profile that you want to build (leave blank for default, else profile names space separated) > check options if any like (offline for -o etc) > click run
在 Eclipse 中右键单击项目目录 > Run As > Run Configurations... > 双击 Maven Build > 填写名称,选择项目的基本目录,提供目标(例如全新安装),提供您要构建的配置文件(离开默认为空白,否则配置文件名称以空格分隔)> 检查选项是否有任何类似(-o 等脱机)> 单击运行
this will be available in your menu bar for future usage.
这将在您的菜单栏中提供以供将来使用。
回答by ISteve
If you want to run mvn from the cmd.exe you must:
如果您想从 cmd.exe 运行 mvn,您必须:
1) Download maven (https://maven.apache.org/download.cgi)
1) 下载 maven ( https://maven.apache.org/download.cgi)
2) Add it to your Path and configure JAVA_HOME (see: https://maven.apache.org/install.html)
2) 将其添加到您的 Path 并配置 JAVA_HOME (请参阅:https: //maven.apache.org/install.html)
3) Navigate to the root directory of your project (in cmd.exe)
3)导航到项目的根目录(在cmd.exe中)
4) Run mvn (and any of the options like clean or install etc)
4)运行 mvn(以及任何选项,如清理或安装等)
5) Then you can run "mvn . . . . . something"
5)然后你可以运行“mvn . . . . something”