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

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

Go to download

Tools for working with IBM WebSphere 6.0.x and 6.1.x. This plugin works along with an installation of WebSphere Application Server or Process Server - standalone or ND installation, to provide automated tasks for: generating RMIC stubs, starting/stopping servers, installing/updating/uninstalling EARs to application servers, run serviceDeploy and run arbitrary scripts with wsadmin.

There is a newer version: 1.2.1
Show newest version
package org.codehaus.mojo.was6;

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

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.codehaus.plexus.util.FileUtils;
import org.dom4j.Document;

/**
 * Cleans out temporary resources and generated sources.
 * 
 * @goal clean
 * @phase clean
 * @author David J. M. Karlsen
 */
public class CleanMojo
    extends AbstractEjbMojo
{

    /**
     * {@inheritDoc}
     */
    public void execute()
        throws MojoExecutionException, MojoFailureException
    {
        nullSafeDeleteDirectory( getWorkingDirectory() );
        nullSafeDeleteDirectory( getGeneratedSourcesDirectory() );
    }

    /**
     * Deletes a directory.
     * 
     * @param directory to be deleted, null is handled gracefully.
     */
    private void nullSafeDeleteDirectory( File directory )
    {
        if ( directory != null )
        {
            try
            {
                getLog().info( "Deleting directory: " + directory.getAbsolutePath() );
                FileUtils.deleteDirectory( directory );
            }
            catch ( IOException e )
            {
                getLog().error( e );
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    protected String getTaskName()
    {
        return null;
    }

    /**
     * {@inheritDoc}
     */
    protected void configureBuildScript( Document document )
        throws MojoExecutionException
    {
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy