且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

maven构建目标需要指定

更新时间:2023-09-17 21:04:28

通过右键单击您的项目或您的 .pom $,您可以使用m2e构建一个maven项目c $ c>,选择运行为然后 Maven构建... 然后写入 package 进入目标字段,然后点击运行



相应的键盘快捷键是 Alt + Ctrl + X ,然后 m - 它会让你进入同一个对话框。



结果可能是您项目的目标子文件夹中的 .war 文件。 / p>

I have extracted a sample Struts 2 project and it has the maven pom.xml file. I already installed the m2e plugin for eclipse. But when I right click the pom.xml file and select Maven Build it gives me the below error.

No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]

What is the goal I need to specify in the m2e window when I click on Maven build?

You can build a maven project with m2e by right-clicking your project or your .pom, selecting Run as then Maven build... then write package into the goal field and click Run.

The according keyboard shortcut is Alt+Ctrl+X, then m - it will get you to the same dialog.

The result will probably be a .war file in the target subfolder of your project.