2 Replies Latest reply on Apr 22, 2009 1:19 AM by Cruz Fernandez

    Problem with Maven Instrumentation Plugin

    Cruz Fernandez Newbie

      I have tried to integrate the maven-plugin that instrumentates classes to my maven-build-project.


      I configured it like this:


      <plugin>
           <groupId>org.jboss.seam</groupId>
           <artifactId>seam-instrument-wicket</artifactId>
           <version>2.1.2-SNAPSHOT</version>
           <configuration>
                <includes>
                     <param>.*</param>
                </includes>
           </configuration>
      
           <executions>
                <execution>
                     <phase>compile</phase>
                     <goals>
                          <goal>instrument</goal>
                     </goals>
                </execution>
           </executions>
      
      </plugin>
      



      and added the pluginrepo:


      <pluginRepositories>
           <pluginRepository>
                <id>jboss.seam</id>
                <name>SEam jboss</name>
                <url>http://snapshots.jboss.org/maven2</url>
                <layout>default</layout>
                <snapshots>
                     <enabled>true</enabled>
                </snapshots>
                <releases>
                     <updatePolicy>never</updatePolicy>
                </releases>
           </pluginRepository>
      </pluginRepositories>
      



      The problem is that when I have a dependency of the scope provided, it is not being used on the classpath of the instrumentator (NoClassDefFound error).


      I have modified the MOJO plugin to use a compile scope (the default is runtime, where the dependency provided is not include), and it was fixed:


      Index: src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java
      ===================================================================
      --- src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java     (revisión: 10298)
      +++ src/main/java/org/jboss/seam/wicket/InstrumentationMojo.java     (copia de trabajo)
      @@ -20,7 +20,7 @@
        * This mojo takes classes specified with the "includes" parameter in the plugin configuration
        * and instruments them with Seam's Wicket JavassistInstrumentor.
        * @goal instrument
      - * @requiresDependencyResolution
      + * @requiresDependencyResolution compile
        * @phase process-classes
        */
       public class InstrumentationMojo extends AbstractMojo
      



      is this a real fix? Should I open a JIRA issue?