Author: tchemit Date: 2008-07-22 23:23:54 +0000 (Tue, 22 Jul 2008) New Revision: 878 Modified: trunk/maven-genclean-plugin/ trunk/maven-genclean-plugin/pom.xml trunk/maven-genclean-plugin/src/main/java/org/codelutin/maven/plugin/GenCleanMojo.java Log: first import of maven-genclean-plugin Property changes on: trunk/maven-genclean-plugin ___________________________________________________________________ Name: svn:ignore + target Modified: trunk/maven-genclean-plugin/pom.xml =================================================================== --- trunk/maven-genclean-plugin/pom.xml 2008-07-22 23:06:39 UTC (rev 877) +++ trunk/maven-genclean-plugin/pom.xml 2008-07-22 23:23:54 UTC (rev 878) @@ -23,6 +23,12 @@ <dependencies> + <dependency> + <groupId>org.codelutin</groupId> + <artifactId>lutinutil</artifactId> + <version>0.30-SNAPSHOT</version> + </dependency> + <!-- maven plugin project dependencies --> <dependency> Modified: trunk/maven-genclean-plugin/src/main/java/org/codelutin/maven/plugin/GenCleanMojo.java =================================================================== --- trunk/maven-genclean-plugin/src/main/java/org/codelutin/maven/plugin/GenCleanMojo.java 2008-07-22 23:06:39 UTC (rev 877) +++ trunk/maven-genclean-plugin/src/main/java/org/codelutin/maven/plugin/GenCleanMojo.java 2008-07-22 23:23:54 UTC (rev 878) @@ -18,7 +18,6 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; -import static org.codelutin.i18n.I18n._; import java.io.File; @@ -30,7 +29,7 @@ * @goal clean * @phase clean */ -public abstract class GenCleanMojo extends AbstractMojo { +public class GenCleanMojo extends AbstractMojo { /** * @description D�pendance du projet. @@ -51,24 +50,22 @@ */ protected boolean verbose; - - protected abstract void doExecute() throws Exception; - public void execute() throws MojoExecutionException, MojoFailureException { try { - if (genDirectory.exists()) { + if (!genDirectory.exists()) { if (verbose) { - getLog().info("delete gen directory " + genDirectory); + getLog().warn("could not find gen directory " + genDirectory); } - genDirectory.delete(); - } else { - if (verbose) { - getLog().info("could not find gen directory " + genDirectory); - } + return; } + if (verbose) { + getLog().info("delete gen directory " + genDirectory); + } + org.codelutin.util.FileUtil.deleteRecursively(genDirectory); + } catch (Exception e) { getLog().error(e); Throwable e2 = e;