MojoDescriptor md = pd.getMojo( "test" );
AntMojoWrapper wrapper =
new AntMojoWrapper( new AntScriptInvoker( md, Thread.currentThread().getContextClassLoader() ) );
wrapper.enableLogging( new ConsoleLogger( Logger.LEVEL_DEBUG, "test" ) );
MockControl artifactCtl = null;
MockControl pathTranslatorCtl = null;
if ( includeImplied )
{
File pluginXmlFile = new File( StringUtils.replace( resource.getPath(), "%20", " " ) );
File jarFile = File.createTempFile( "AntMojoWrapperTest.", ".test.jar" );
jarFile.deleteOnExit();
JarArchiver archiver = new JarArchiver();
archiver.enableLogging( new ConsoleLogger( Logger.LEVEL_ERROR, "archiver" ) );
archiver.setDestFile( jarFile );
archiver.addFile( pluginXmlFile, pluginXml );
archiver.createArchive();
artifactCtl = MockControl.createControl( Artifact.class );