如何运行命令 mvn eclipse:eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15633951/
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
how to run the command mvn eclipse:eclipse
提问by ulkas
I'm following these instructions, but having problems with running commands like mvn eclipse:eclipse
.
我正在遵循这些说明,但在运行mvn eclipse:eclipse
.
How and where shall I run the command?
我应该如何以及在哪里运行命令?
My setup:
我的设置:
- Windows 7 32bit
- Eclipse Java EE IDE for Web Developers.
- Version: Juno Service Release 2
- Build id: 20130225-0426
- m2e - maven integration for eclipse v 1.3.0
- 视窗 7 32 位
- 面向 Web 开发人员的 Eclipse Java EE IDE。
- 版本:Juno 服务版本 2
- 内部版本号:20130225-0426
- m2e - Eclipse v 1.3.0 的 maven 集成
I installed the m2e via the plugin installation in Eclipse.
我通过 Eclipse 中的插件安装安装了 m2e。
回答by PSR
Right click on the project
右键单击项目
->Run As
--> Run configurations
.
-> Run As
--> Run configurations
。
Then select Maven Build
然后选择 Maven Build
Then click newbutton to create a configuration of the selected type. Click on Browse workspace
(now is Workspace...
) then select your project and in goals specify eclipse:eclipse
然后单击新建按钮以创建所选类型的配置。单击Browse workspace
(现在是Workspace...
)然后选择您的项目并在目标中指定eclipse:eclipse
回答by kostja
The m2e plugin uses it's own distribution of Maven, packaged with the plugin.
m2e 插件使用它自己的 Maven 发行版,与插件打包在一起。
In order to use Maven from command line, you need to have it installed as a standalone application. Hereis an instruction explaining how to do it in Windows
为了从命令行使用 Maven,您需要将其安装为独立应用程序。这是说明如何在 Windows 中执行此操作的说明
Once Maven is properly installed (i.e. be sure that MAVEN_HOME
, JAVA_HOME
and PATH
variables are set correctly): you must run mvn eclipse:eclipse
from the directory containing the pom.xml
.
一旦 Maven 正确安装(即确保MAVEN_HOME
,JAVA_HOME
和PATH
变量设置正确):您必须mvn eclipse:eclipse
从包含pom.xml
.
回答by belgoros
I don't think one needs it any more. The latest versions of Eclipse have Maven plugin enabled. So you will just need to import a Maven projectinto Eclipse and no more as an existing project. Eclipse will create the needed .project, .settings, .classpath files based on your pom.xml and environment settings (installed Java version, etc.) . The earlier versions of Eclipse needed to have run the command mvn eclipse:eclipse
which produced the same result.
我认为人们不再需要它了。最新版本的 Eclipse 启用了 Maven 插件。因此,您只需要将Maven 项目导入 Eclipse,而不再作为现有项目导入。Eclipse 将根据您的 pom.xml 和环境设置(安装的 Java 版本等)创建所需的 .project、.settings、.classpath 文件。早期版本的 Eclipse 需要运行mvn eclipse:eclipse
产生相同结果的命令。
回答by Pablo Thiele
Besides the powerful options on the "Run Configurations.." on a well configured project you'll see the maven tasks on the Run As as well.
除了在配置良好的项目上的“运行配置..”上的强大选项之外,您还将在运行中看到 maven 任务。