maven构建目标需要指定 [英] maven build goal need to specify

查看:168
本文介绍了maven构建目标需要指定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经提取了一个示例Struts 2项目,它有maven pom.xml文件。我已经安装了用于eclipse的m2e插件。但是当我右键单击pom.xml文件并选择Maven Build时,它会给出以下错误。


没有为此指定任何目标建立。您必须以以下格式指定有效的
生命周期阶段或目标:或
:[:]:。
可用的生命周期阶段是:验证,初始化,
生成源,进程源,生成资源,
进程资源,编译,进程类,生成测试源,
进程测试源,生成测试资源,进程测试资源,
测试编译,进程测试类,测试,准备包,包,
预集成测试,集成测试,后整合测试,验证,
安装,部署,站点前,站点,站点后,站点部署,预清洁,
清洁,后整洁。 - > [帮助1]


当我点击Maven构建时,我需要在m2e窗口中指定什么目标? p>

解决方案

通过右键单击您的项目或您的 .pom ,选择运行为然后 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.

这篇关于maven构建目标需要指定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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