[jboss-svn-commits] JBL Code SVN: r14171 - in labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin: src/main/java/org/jboss/maven/plugins/retro and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Aug 13 11:03:52 EDT 2007


Author: pgier
Date: 2007-08-13 11:03:51 -0400 (Mon, 13 Aug 2007)
New Revision: 14171

Added:
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/AbstractWeaveMojo.java
Modified:
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/pom.xml
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveDependenciesMojo.java
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveMojo.java
   labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveTestsMojo.java
Log:
Add ability to fork retroing process.  Refactored common code into abstract parent class.  Updates to make weaver loosely coupled to the jboss-retro classes.


Property changes on: labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin
___________________________________________________________________
Name: svn:ignore
   - target
.classpath
.project
.settings
bin

   + target
.classpath
.project
.settings
bin
eclipse-target


Modified: labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/pom.xml
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/pom.xml	2007-08-13 13:47:56 UTC (rev 14170)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/pom.xml	2007-08-13 15:03:51 UTC (rev 14171)
@@ -95,7 +95,7 @@
     <dependency>
       <groupId>org.jboss</groupId>
       <artifactId>jboss-retro</artifactId>
-      <version>[1.1.2, 1.2.0)</version>
+      <version>1.1.3-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>

Added: labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/AbstractWeaveMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/AbstractWeaveMojo.java	                        (rev 0)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/AbstractWeaveMojo.java	2007-08-13 15:03:51 UTC (rev 14171)
@@ -0,0 +1,177 @@
+package org.jboss.maven.plugins.retro;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+import org.jboss.weaver.Main;
+
+/**
+ * Abstract parent of weaver mojos.
+ * @author pgier
+ *
+ */
+public abstract class AbstractWeaveMojo extends AbstractMojo
+{
+   public static final String JBOSS_RETRO_ARTIFACTID = "jboss-retro";
+   
+   protected final String fileSep = File.separator;
+
+   protected final String pathSep = File.pathSeparator;
+
+   /**
+    * The Maven Project Object
+    *
+    * @parameter expression="${project}"
+    * @required
+    * @readonly
+    */
+   protected MavenProject project;
+
+   /**
+    * The Maven Project Helper Object
+    *
+    * @component
+    * @required
+    * @readonly
+    */
+   protected org.apache.maven.project.MavenProjectHelper projectHelper;
+
+   /**
+    * The plugin dependencies.
+    *
+    * @parameter expression="${plugin.artifacts}"
+    * @required
+    * @readonly
+    */
+   protected List pluginArtifacts;
+
+   /**
+    * Include verbose output.
+    * @parameter default-value="false"
+    */
+   protected boolean verbose = false;
+
+   /**
+    * Use the system classpath.
+    * @parameter default-value="false"
+    */
+   protected boolean useSystemClasspath = false;
+   
+   /**
+    * Suppress output information.
+    * @parameter default-value="false"
+    */
+   protected boolean suppress = false;
+   
+   /**
+    * The Weaver class to use for weaving the classes.
+    * Defaults to org.jboss.weaver.Weaver
+    * Any subclass of org.jboss.weaver.Weaver can be used.
+    * To compile from jdk1.5 to jdk1.4, set this to "org.jboss.weaver.retro.WeaverRetroJdk14".
+    * 
+    * @parameter default-value="org.jboss.weaver.Weaver"
+    */
+   protected String weaverClass = "org.jboss.weaver.Weaver";
+
+   /**
+    * Classifier to append to the weaved output file (artifact).
+    * Defaults to null.  If the classifier is null, then the jar
+    * of the weaved classes will replace the main artifact.
+    * 
+    * @parameter
+    */
+   protected String classifier;
+   
+   /**
+    * Returns the path to which weaved files should be written.
+    * @return The output path.
+    */
+   protected abstract String getOutputPath();
+      
+   /**
+    * Fork the process to a separate jvm
+    * @parameter
+    */
+   protected boolean fork = true;
+   
+   /**
+    * Path to Java virtual machine to use when forking
+    * @parameter
+    */
+   protected String jvm;
+   
+   
+   protected String getJarClassifier() 
+   {
+      return this.classifier;
+   }
+
+   /**
+    * Consume and log command output from the retro process
+    * @author pgier
+    */
+   public class MojoLogStreamConsumer implements StreamConsumer
+   {
+      public void consumeLine(String line)
+      {
+         getLog().info(line);
+      }
+   }
+   
+   public void doWeave(String classpath, String [] args) throws Exception
+   {
+      if (fork)
+      {
+         Commandline cli = new Commandline();
+         
+         if ( jvm == null || jvm.equals( "" ) )
+         {
+             // use the same JVM as the one used to run Maven (the "java.home" one)
+             jvm = System.getProperty( "java.home" ) + File.separator + "bin" + File.separator + "java";
+             getLog().debug( "Using JVM: " + jvm );
+         }
+
+         cli.setExecutable( jvm );
+         String [] jvmArgs = new String[3];
+         jvmArgs[0] = "-cp";
+         jvmArgs[1] = classpath;
+         jvmArgs[2] = Main.class.getName();
+         cli.addArguments(jvmArgs);
+         
+         cli.addArguments(args);
+         
+         StreamConsumer out = new MojoLogStreamConsumer();
+         StreamConsumer err = new MojoLogStreamConsumer();
+
+         getLog().debug("Forking Command Line: ");
+         getLog().debug(cli.toString());
+         getLog().debug("");
+         
+         try
+         {
+            int returnCode = CommandLineUtils.executeCommandLine( cli, out, err );
+            if ( returnCode != 0)
+            {
+               throw new MojoExecutionException("There were errors during the weave");
+            }
+         }
+         catch ( CommandLineException e )
+         {
+            throw new MojoExecutionException( "Error while executing forked tests.", e );
+         }
+         
+      }
+      else
+      {
+         Main.main(args);
+      }
+      
+   }     
+}

Modified: labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveDependenciesMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveDependenciesMojo.java	2007-08-13 13:47:56 UTC (rev 14170)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveDependenciesMojo.java	2007-08-13 15:03:51 UTC (rev 14171)
@@ -3,6 +3,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -25,50 +26,22 @@
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.ProjectArtifactMetadata;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
-import org.jboss.weaver.WeaveRunner;
-import org.jboss.weaver.Weaver;
 
 /**
  * This Mojo can be used to weave project dependencies.
- * WARNING: Implementation of this mojo is not complete!
  * 
  * @goal weave-dependencies
  * @requiresDependencyResolution
  */
-public class WeaveDependenciesMojo extends AbstractMojo
+public class WeaveDependenciesMojo extends AbstractWeaveMojo
 {
-   public static final String JBOSS_RETRO_ARTIFACTID = "jboss-retro";
-   
-   protected final String fileSep = File.separator;
 
-   protected final String pathSep = File.pathSeparator;
-
    /**
-    * The Maven Project Object
-    *
-    * @parameter expression="${project}"
-    * @required
-    * @readonly
-    */
-   protected MavenProject project;
-
-   /**
-    * The Maven Project Helper Object
-    *
-    * @component
-    * @required
-    * @readonly
-    */
-   protected org.apache.maven.project.MavenProjectHelper projectHelper;
-
-   /**
     * INTERNAL : Artifact resolver, needed to download dependencies
     *
     * @component role="org.apache.maven.artifact.resolver.ArtifactResolver"
@@ -143,12 +116,6 @@
    protected List pluginArtifacts;
 
    /**
-    * Include verbose output.
-    * @parameter default-value="false"
-    */
-   protected boolean verbose;
-   
-   /**
     * URL where the artifact will be deployed. <br/>
     * ie ( file://C:\m2-repo or scp://host.com/path/to/repo )
     * Note: this parameter is required if deployDependencies is set 
@@ -160,12 +127,6 @@
    private String deployUrl;
 
    /**
-    * Suppress output information.
-    * @parameter default-value="true"
-    */
-   protected boolean suppress;
-
-   /**
     * The type of remote repository layout to deploy to. Try <i>legacy</i> for 
     * a Maven 1.x-style repository layout.
     * 
@@ -175,21 +136,12 @@
    private String repositoryLayout;
 
    /**
-    * The Weaver class to use for weaving the classes.
-    * Defaults to org.jboss.weaver.Weaver
-    * Any subclass of org.jboss.weaver.Weaver can be used
-    * 
-    * @parameter default-value="org.jboss.weaver.Weaver"
-    */
-   protected String weaverClass;
-
-   /**
-    * The jar file or directory where the weaved classes
+    * The directory where the weaved jar files should be written.
     * should be written.
     *
     * @parameter expression="${project.build.directory}/weaved-dependencies"
     */
-   protected String dependencyOutputDirectory;
+   protected String outputDirectory;
 
    /**
     * Component used to create a repository
@@ -253,12 +205,9 @@
       
       this.getLog().info("Weaving dependencies");
       
-      long start = System.currentTimeMillis();
-      
       weaveDependencies();
       
-      long end = System.currentTimeMillis();
-      this.getLog().info("Weaving complete: " + (end - start) + "ms");
+      this.getLog().info("Weaving complete.");
    }
    
    protected void weaveDependencies() throws MojoFailureException, MojoExecutionException 
@@ -272,7 +221,7 @@
                project.getArtifact(), project.getRemoteArtifactRepositories(), localRepository, artifactMetadataSource);
          Set artifacts = result.getArtifacts();
          
-         File parentDir = new File(dependencyOutputDirectory);
+         File parentDir = new File(this.getOutputPath());
          if ( ! parentDir.exists()) {
             parentDir.mkdirs();
          }
@@ -281,21 +230,24 @@
          {
             Artifact artifact = (Artifact)artifactObj;
             
-            WeaveRunner weaveRunner = this.createWeaveRunner(artifacts);
-            File outputFile = new File(dependencyOutputDirectory + File.separator + artifact.getFile().getName());
-            weaveRunner.setOutputPath(outputFile.getAbsolutePath());
+            getLog().info("Weaving " + artifact);
+            String srcJar = artifact.getFile().getAbsolutePath();
+            File outputJarFile = new File(this.getOutputPath() + File.separator + artifact.getFile().getName());
+            String destJar = outputJarFile.getAbsolutePath();
+            String classpath = buildClasspath(artifacts);
+            String [] args = this.generateWeaverArgs(classpath, srcJar, destJar);
             
-            try
+            try 
             {
-               getLog().info("Weaving " + artifact);
-               weaveRunner.addSourcePath(artifact.getFile().getAbsolutePath());
-               weaveRunner.weave();
+               doWeave(classpath, args);
             }
             catch (Exception e)
             {
-               e.printStackTrace();
+               getLog().warn("Exception while weaving " + artifact.getArtifactId() + "\n" +
+                     e.getMessage());
             }
-            weavedDependencies.put(artifact, outputFile);
+                        
+            weavedDependencies.put(artifact, outputJarFile);
          }
 
          if (this.installDependencies)
@@ -320,25 +272,36 @@
       {
          throw new MojoExecutionException(e.getMessage(), e);
       }
-      
    }
    
-   public WeaveRunner createWeaveRunner(Set artifacts) throws MojoFailureException
+   protected String [] generateWeaverArgs(String classpath, String srcJar, String destJar) 
    {
+      ArrayList<String> argsList = new ArrayList<String> ();
+      if (this.verbose)
+      {
+         argsList.add("-verbose");
+      }
+      if (this.suppress)
+      {
+         argsList.add("-suppress");
+      }
+      argsList.add("-cp");
+      argsList.add(classpath);
+      argsList.add("-useSystemClasspath");
+      argsList.add("false");
+      if (this.weaverClass !=null)
+      {
+         argsList.add("-weaverClass");
+         argsList.add(this.weaverClass);
+      }
+      argsList.add("-outputJar");
+      argsList.add(destJar);
+      argsList.add(srcJar);
       
-      Weaver weaver = this.instantiateWeaver();
-      String classpath = this.buildClasspath(artifacts);
-      weaver.setClasspath(classpath);
-      weaver.init();
-      
-      WeaveRunner weaveRunner = new WeaveRunner(weaver);
-      weaveRunner.setVerbose(verbose);
-      weaveRunner.setSuppress(suppress);
-      weaveRunner.setUsingSystemClasspath(false);
-      weaveRunner.setOutputToJar(true);
-      
-      return weaveRunner;
+      String [] args = new String[argsList.size()];
+      return argsList.toArray(args);
    }
+   
       
    /**
     * Generates a classpath string based on the resolved dependencies.
@@ -374,27 +337,6 @@
       return classpath.toString();
    }
       
-   /**
-    * This method creates the weaver instance.  Subclass mojos
-    * can use this class to override the default weaver configuration.
-    * @return The weaver instance
-    */
-   protected Weaver instantiateWeaver() throws MojoFailureException {
-      // We have to set the classpath first because the initialization
-      // may require access to the classpath.
-      Weaver weaver = null;
-
-      try {
-         weaver = (Weaver)Class.forName(weaverClass).newInstance();
-      } catch (Exception e) {
-         getLog().error("Unable to instantiate weaver class: " + this.weaverClass);
-         getLog().error(e.getMessage());
-         throw new MojoFailureException(e.getMessage());
-      }
-      
-      return weaver;
-   }
-   
    protected File getPomFile(Artifact artifact) throws MojoExecutionException
    {
       Artifact pomArtifact = null;
@@ -468,7 +410,6 @@
          
          try
          {
-            //getLog().info("Deploying " + artifact);
             getDeployer().deploy( weavedArtifactFile, artifact, deploymentRepository, getLocalRepository() );
          }
          catch ( ArtifactDeploymentException e )
@@ -482,7 +423,7 @@
    {
       
       File pomFile = getPomFile(artifact);
-      File retroPomFile = new File(this.dependencyOutputDirectory + File.separator + artifact.getArtifactId() + "-" + artifact.getVersion() + ".pom");
+      File retroPomFile = new File(this.getOutputPath() + File.separator + artifact.getArtifactId() + "-" + artifact.getVersion() + ".pom");
       
       try 
       {
@@ -516,5 +457,10 @@
    {
       this.localRepository = localRepository;
    }
+   
+   public String getOutputPath()
+   {
+      return this.outputDirectory;
+   }
          
 }

Modified: labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveMojo.java	2007-08-13 13:47:56 UTC (rev 14170)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveMojo.java	2007-08-13 15:03:51 UTC (rev 14171)
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
@@ -9,12 +10,9 @@
 import org.apache.commons.io.filefilter.NameFileFilter;
 import org.apache.commons.io.filefilter.TrueFileFilter;
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
 import org.jboss.maven.plugins.retro.util.JarUtil;
-import org.jboss.weaver.WeaveRunner;
-import org.jboss.weaver.Weaver;
 
 /**
  * Maven plugin for JBoss Retro Weaver.  This can be used to 
@@ -26,38 +24,10 @@
  * @goal weave
  * 
  */
-public class WeaveMojo extends AbstractMojo
+public class WeaveMojo extends AbstractWeaveMojo
 {
-   public static final String JBOSS_RETRO_ARTIFACTID = "jboss-retro";
-   
-   protected final String fileSep = File.separator;
 
-   protected final String pathSep = File.pathSeparator;
-
    /**
-    * List of the jar file entries
-    */
-   //private ArrayList<JarFileEntry> fileEntries = new ArrayList<JarFileEntry>();
-
-   /**
-    * The Maven Project Object
-    *
-    * @parameter expression="${project}"
-    * @required
-    * @readonly
-    */
-   protected MavenProject project;
-
-   /**
-    * The Maven Project Helper Object
-    *
-    * @component
-    * @required
-    * @readonly
-    */
-   protected org.apache.maven.project.MavenProjectHelper projectHelper;
-
-   /**
     * The plugin dependencies.
     *
     * @parameter expression="${plugin.artifacts}"
@@ -67,15 +37,6 @@
    protected List pluginArtifacts;
 
    /**
-    * Project classpath.
-    *
-    * @parameter expression="${project.compileClasspathElements}"
-    * @required
-    * @readonly
-    */
-   protected List classpathElements;
-   
-   /**
     * The directory for compiled classes.
     *
     * @parameter expression="${project.build.outputDirectory}"
@@ -83,22 +44,8 @@
     */
    protected File classesDirectory;
 
-   /**
-    * Include verbose output.
-    * @parameter
-    */
-   protected boolean verbose = false;
 
    /**
-    * The Weaver class to use for weaving the classes.
-    * Defaults to org.jboss.weaver.Weaver
-    * Any subclass of org.jboss.weaver.Weaver can be used
-    * 
-    * @parameter
-    */
-   protected String weaverClass = "org.jboss.weaver.Weaver";
-
-   /**
     * The directory where the weaved classes
     * should be written.
     * @parameter expression="${project.build.directory}/classes-weaved"
@@ -113,24 +60,17 @@
    protected boolean attachJar = false;
    
    /**
-    * Classifier to append to the weaved output file (artifact).
-    * Defaults to null.  If the classifier is null, then the jar
-    * of the weaved classes will replace the main artifact.
-    * 
-    * @parameter
+    * Project classpath.
+    *
+    * @parameter expression="${project.compileClasspathElements}"
+    * @required
     */
-   protected String classifier;
+   protected List classpathElements;
    
    /**
-    * Suppress output information.
-    * @parameter
-    */
-   protected boolean suppress = true;
-
-   /**
     * Main plugin execution method
     */   
-   public void execute() throws MojoFailureException
+   public void execute() throws MojoFailureException, MojoExecutionException
    {
       if ( ( ! this.getClassesDirecotry().exists()) 
             || ( ! this.getClassesDirecotry().isDirectory()))
@@ -140,9 +80,16 @@
       }
       
       this.getLog().info("Weaving classes in: " + this.getClassesDirecotry());
-      long start = System.currentTimeMillis();
       
-      weaveClasses();
+      try 
+      {
+         doWeave(this.buildWeaveClasspath(), this.generateWeaverArgs());
+      }
+      catch (Exception e)
+      {
+         throw new MojoExecutionException("Error during weave: " + e);
+      }
+      this.getLog().info("Weaving complete.");
       if (this.attachJar) 
       {
          String jarFilePath = project.getBuild().getDirectory()
@@ -151,40 +98,44 @@
          {
             File jarFile = JarUtil.createJarFile(this.getOutputPath(), jarFilePath);
             projectHelper.attachArtifact(project, jarFile, this.getJarClassifier());
+            getLog().info("Weaved jar file created: " + jarFile.getAbsolutePath());
          }
          catch (IOException ioe) 
          {
             getLog().warn("Unable to create Jar file: " + ioe);
          }
       }
-      
-      long end = System.currentTimeMillis();
-      this.getLog().info("Weaving complete: " + (end - start) + "ms");
    }
-   
-   protected void weaveClasses() throws MojoFailureException {
-      // Initialize the WeaveRunner using plugin params
-      Weaver weaver = instantiateWeaver();
-      weaver.setClasspath(this.buildClasspath());
-      weaver.init();
-      WeaveRunner weaveRunner = new WeaveRunner(weaver);
-
-      weaveRunner.setVerbose(verbose);
-      weaveRunner.setSuppress(suppress);
-      weaveRunner.setUsingSystemClasspath(false);
       
-      weaveRunner.setOutputPath(getOutputPath()); 
-      
-      try
+   protected String [] generateWeaverArgs() 
+   {
+      ArrayList<String> argsList = new ArrayList<String> ();
+      if (this.verbose)
       {
-         weaveRunner.addSourcePath(this.getClassesDirecotry().getAbsolutePath());
-         weaveRunner.weave();
+         argsList.add("-verbose");
       }
-      catch (Exception e)
+      if (this.suppress)
       {
-         this.getLog().error(e);
-         e.printStackTrace();
+         argsList.add("-suppress");
       }
+      if (this.useSystemClasspath)
+      {
+         argsList.add("-useSystemClasspath");
+         argsList.add(Boolean.toString(useSystemClasspath));
+      }
+      argsList.add("-cp");
+      argsList.add(buildWeaveClasspath());
+      if (this.weaverClass !=null)
+      {
+         argsList.add("-weaverClass");
+         argsList.add(this.weaverClass);
+      }
+      argsList.add("-outputDir");
+      argsList.add(this.getOutputPath());
+      argsList.add(this.getClassesDirecotry().getAbsolutePath());
+      
+      String [] args = new String[argsList.size()];
+      return argsList.toArray(args);
    }
    
    /**
@@ -192,7 +143,7 @@
     * and the plugin dependencies.
     * @return
     */
-   protected String buildClasspath() {
+   protected String buildWeaveClasspath() {
       StringBuilder classpath = new StringBuilder();
 
       List cpElements = this.getClasspathElements();
@@ -234,43 +185,24 @@
       }
       return classpath.toString();
    }
-      
-   /**
-    * This method creates the weaver instance.  Subclass mojos
-    * can use this class to override the default weaver configuration.
-    * @return The weaver instance
-    */
-   protected Weaver instantiateWeaver() throws MojoFailureException {
-      // We have to set the classpath first because the initialization
-      // may require access to the classpath.
-      Weaver weaver = null;
-
-      try {
-         weaver = (Weaver)Class.forName(weaverClass).newInstance();
-      } catch (Exception e) {
-         getLog().error("Unable to instantiate weaver class: " + this.weaverClass);
-         getLog().error(e.getMessage());
-         throw new MojoFailureException(e.getMessage());
-      }
-      
-      return weaver;
-   }
-   
+         
    protected String getOutputPath() 
    {
       return this.outputDirectory.getAbsolutePath();
    }
    
-   public List getClasspathElements() {
-      return this.classpathElements;
-   }
-   
-   public File getClassesDirecotry() {
+   public File getClassesDirecotry() 
+   {
       return this.classesDirectory;
    }
    
-   protected String getJarClassifier() {
-      return this.classifier;
+   /**
+    * Get the list of classpath elements to use for weaving.
+    * @return
+    */
+   public List getClasspathElements() 
+   {
+      return this.classpathElements;
    }
-   
+      
 }

Modified: labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveTestsMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveTestsMojo.java	2007-08-13 13:47:56 UTC (rev 14170)
+++ labs/jbossbuild/maven-plugins/trunk/maven-jboss-retro-plugin/src/main/java/org/jboss/maven/plugins/retro/WeaveTestsMojo.java	2007-08-13 15:03:51 UTC (rev 14171)
@@ -20,7 +20,7 @@
     *
     * @parameter expression="${project.testClasspathElements}"
     * @required
-    * @readonly
+    * 
     */
    protected List classpathElements;
       
@@ -29,7 +29,7 @@
     *
     * @parameter expression="${project.build.testOutputDirectory}"
     * @required
-    * @readonly
+    * 
     */
    protected File classesDirectory;
 
@@ -41,12 +41,6 @@
     */
    protected File outputDirectory;
       
-   /**
-    * Suppress output information.
-    * @parameter
-    */
-   protected boolean suppress = true;
-   
    public List getClasspathElements() 
    {
       return this.classpathElements;




More information about the jboss-svn-commits mailing list