All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tpspay.postmaven.postbuild.PostCleanMojo Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package com.tpspay.postmaven.postbuild;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

/**
 * Goal to clean postilion's build directory
 * 
 * @goal post-clean
 * 
 * @phase clean
 * 
 * @author John Oxley <[email protected]>
 */
public class PostCleanMojo extends AbstractPostilionBuildMojo {
	public void execute() throws MojoExecutionException, MojoFailureException {
		try {
			File dir = new File("build");
			if (!dir.exists()) {
				return;
			}

			File generatedFile = new File(buildGeneratedFile);
			if (generatedFile.exists()) {
				generatedFile.delete();
			}

			getLog().info("Deleting " + dir.getAbsolutePath());
			FileUtils.deleteDirectory(dir);
		} catch (IOException e) {
			throw new MojoExecutionException("Problem deleting build directory", e);
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy