Sorry it has taken me a while to look into this since you posted your
patch on sling-users.

There seems to be a bug in the emma plugin which causes the value of
project.build.outputDirectory to be changed to
target/generated-classes/emma/classes. AFAIK, this isn't supposed to be
allowed, but I guess it is.

In any case, there's an easy enough work around - manually set the
outputDirectory property of the bundle plugin. You also need to use the
bundle plugin, not the jar plugin to package the instrumented bundle.

Here's what the updated patch to Sling's Commons JSON module looks like:
http://codereview.appspot.com/1772041/patch/1/3

Justin


On 7/8/10 2:39 PM, D. Stuart Freeman wrote:
> I'm trying to instrument some bundles with emma so that I can run
> integration tests against them and get coverage stats out.
> 
> I've added the following to my project's base pom:
> 
> <build>
> ...
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>emma-maven-plugin</artifactId>
>         <version>1.0-alpha-2</version>
>         <inherited>true</inherited>
>         <executions>
>           <execution>
>             <phase>prepare-package</phase>
>             <goals>
>               <goal>instrument</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-jar-plugin</artifactId>
>         <executions>
>           <execution>
>             <id>emma-jar</id>
>             <phase>package</phase>
>             <goals>
>               <goal>jar</goal>
>             </goals>
>             <configuration>
>               <classifier>emma</classifier>
>               
> <classesDirectory>${maven.build.dir}/generated-classes/emma/classes</classesDirectory>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
> ...
> </build>
> 
> That seems to give me instrumented and uninstrumented artifacts, but the
> bnd plugin seems to add emma as a bundle import even on the
> uninstrumented artifacts.  Is there a way to configure it to only add the
> emma dependency to the instrumented bundles?  Is there a better way to
> build instrumented bundles?
> 
> In my search for ways to do this, I've found
> http://www.eclemma.org/research/instrumentingosgi/index.html is there a
> way to do something similar with Felix?
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to