Using maven-clean-plugin with m2e

1.5k views Asked by At

I use here Eclipse with m2e plugin. 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.

I've tried to set up in lifecycle-mapping-metadata.xml, but it didn't work. 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?

(The ideal solution didn't require to start a new jvm, and all run inside of the eclipse process.)

1

There are 1 answers

0
NoDataFound On BEST ANSWER

In lastest version of the m2e plugin, on Luna, you can display what Maven will do:

Eclipse Preference

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.