从日食运行的Maven目标 [英] Maven goal running from eclipse

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

问题描述

当我从命令行运行mvn compile时,它使用pom.xml构建。但是当我尝试在eclipse中运行它(通过使用m2eclipse插件),当我右键单击pom.xml并运行为maven构建,它要求一个目标。我是新来的,想要通过日食运行它。那么为什么从命令行运行时不要求任何东西?是否有默认目标?

When I run mvn compile from command line, it builds using pom.xml. But when I try to run it within eclipse (by using m2eclipse plugin), when I right click on the pom.xml and run as maven build, it asks for a goal. I am new to maven and want to run it through eclipse. So why doesn't it ask for anything when running from command line? Is there a default goal?

谢谢。

推荐答案

有一个默认目标,但它取决于项目,并且可以被明确定义。

Yes, there is a default goal, but what it is depends on the project, and can be explicitly defined.

请参阅 BaseBuild元素集(默认目标是安装)以及该页面的其余部分了解更多信息。 IIRC可以为m2eclipse定义一个默认目标,尽管我在一段时间内没有使用它。

See the BaseBuild Element Set (the default goal is install) as well as the rest of that page for further information. IIRC you can define a default goal for m2eclipse, although I haven't used it in some time.

还有一个设置来定义一个目标,当一个源目录已更新:

There's also a setting to define a goal to be run when a source directory is updated:

http://www.sonatype.com/books/m2eclipse-book/reference/preferences.html

这篇关于从日食运行的Maven目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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