convert resources mojo to new execute().

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163661 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-03-22 13:33:29 +00:00
parent 964aa52888
commit d0de5773b3
1 changed files with 24 additions and 25 deletions

View File

@ -19,8 +19,7 @@ package org.apache.maven.plugin.resources;
import org.apache.maven.model.Resource; import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractPlugin; import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionRequest; import org.apache.maven.plugin.PluginExecutionException;
import org.apache.maven.plugin.PluginExecutionResponse;
import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.FileUtils;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -54,21 +53,15 @@ import java.util.List;
public class ResourcesMojo public class ResourcesMojo
extends AbstractPlugin extends AbstractPlugin
{ {
public void execute( PluginExecutionRequest request, PluginExecutionResponse response ) private String outputDirectory;
throws Exception
private List resources;
public void execute()
throws PluginExecutionException
{
try
{ {
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
String outputDirectory = (String) request.getParameter( "outputDirectory" );
List resources = (List) request.getParameter( "resources" );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
for ( Iterator i = getJarResources( resources ).iterator(); i.hasNext(); ) for ( Iterator i = getJarResources( resources ).iterator(); i.hasNext(); )
{ {
ResourceEntry resourceEntry = (ResourceEntry) i.next(); ResourceEntry resourceEntry = (ResourceEntry) i.next();
@ -83,6 +76,12 @@ public class ResourcesMojo
fileCopy( resourceEntry.getSource(), destinationFile.getPath() ); fileCopy( resourceEntry.getSource(), destinationFile.getPath() );
} }
} }
catch ( Exception e )
{
// TODO: handle exception
throw new PluginExecutionException( "Error copying resources", e );
}
}
private List getJarResources( List resources ) private List getJarResources( List resources )
throws Exception throws Exception