简体   繁体   English

在M2e中使用Maven-clean-plugin

[英]Using maven-clean-plugin with m2e

I use here Eclipse with m2e plugin. 我在这里使用带有m2e插件的Eclipse。 If I do a project clean, it doesn't do anything. 如果我清理项目,则不会执行任何操作。

On my experiments, I see as if m2e simply weren't wired into the eclipse project cleaning option. 在我的实验中,我似乎似乎根本没有将m2e连接到Eclipse项目清理选项中。

I've tried to set up in lifecycle-mapping-metadata.xml , but it didn't work. 我试图在lifecycle-mapping-metadata.xml进行设置,但是没有用。 If I understand this well, maybe a clean can't be set up here, because cleaning is not considered as part of a project lifecycle from the viewpoint of the eclipse. 如果我理解得很好,那么也许就不能在这里进行清理,因为从蚀的角度来看,清理不被视为项目生命周期的一部分。

So, is there any way to do a simple mvn clean from eclipse on a project cleanup? 那么,有什么方法可以在项目清理中从eclipse进行简单的mvn clean清理吗?

(The ideal solution didn't require to start a new jvm, and all run inside of the eclipse process.) (理想的解决方案不需要启动新的jvm,并且全部在eclipse进程内运行。)

In lastest version of the m2e plugin, on Luna, you can display what Maven will do: 在Luna的最新版本的m2e插件中,您可以显示Maven的作用:

Eclipse偏好

This explains why the clean step is never called. 这解释了为什么从未调用干净步骤的原因。

And sadly, it is unsupported in default Eclipse clean, but you can also invoke Maven from Eclipse using Run As > Maven clean . 不幸的是,默认Eclipse clean不支持它,但是您也可以使用Run As> Maven clean从Eclipse调用Maven。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM