Maven auto-clean on package

eclipse, initialization, m2eclipse, maven, package

Solution

It's not a Maven problem, it's m2eclipse. I haven't used it in a long time, but apparently when you add some plugin executions, you have to add additional configuration to m2eclipse. There's a lengthy description of this error on the Eclipse wiki.

Problem

I'm having some troubles trying to auto-clean each time i run mvn package. I've added in the POM : ``` <build> <plugins> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>2.5</version> <executions> <execution> <id>auto-clean</id> <phase>initialize</phase> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> ... </plugins> ... </build> ``` But i'm getting the following error from M2Eclipse : Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-clean-plugin:2.5:clean (execution: auto-clean, phase: initialize) I've tried other phases like "validate" or "generate-resources" but i'm always getting the same error.

Original source