org.codehaus.mojo.was6.CleanMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of was6-maven-plugin Show documentation
Show all versions of was6-maven-plugin Show documentation
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.
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