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

org.codehaus.mojo.sqlj.CleanMojo Maven / Gradle / Ivy

The newest version!
package org.codehaus.mojo.sqlj;

import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;

/**
 * Cleans out generated stale resources.
 * 
 * @author David J. M. Karlsen
 */
@Mojo( name = "clean", defaultPhase = LifecyclePhase.CLEAN )
public class CleanMojo
    extends AbstractSqljMojo
{

    /**
     * {@inheritDoc}
     */
    public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        try
        {
            FileUtils.deleteDirectory( getGeneratedSourcesDirectory() );
            FileUtils.deleteDirectory( getGeneratedResourcesDirectory() );
        }
        catch ( IOException e )
        {
            throw new MojoFailureException( e.getMessage() );
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy