It doesn't seem to be working the same when I add it to a bundle in the sling trunk. I'm attaching the patch anyway, because someone may be able to tell me a better (correct?) way to do it. For some reason this patch doesn't pick up all the classes for the instrumented jar (it does when added to the sakai3/nakamura base pom).
On Thu, Jun 10, 2010 at 04:39:37PM -0400, Justin Edelson wrote: > You should probably post this to the felix users list. > > I don't know much about how Emma works, but it seems quite possible that > if you're going to run the instrumented bundles in the container, emma > is a dependency. > > As for why emma is imported for the instrumented jars, that sounds like > a Maven problem. > > If you can send me a patch which adds Emma to one of the Sling bundles > (i.e. a patch against trunk/bundles/jcr/resource/pom.xml), I can look at > this further. > > Justin > > On 6/10/10 4:34 PM, D. Stuart Freeman wrote: > > Well, I feel silly now, I just had to add emma as a dependency. However, > > now I'm finding that all my bundles (even the uninstrumented copies) > > have an unresolved constraint looking for package=com.vladium.emma.rt. > > Is there a way to tell bnd that's always optional, or do I have to go > > manually add that to each of my poms? > > > > On Tue, Jun 08, 2010 at 01:00:06PM -0400, D. Stuart Freeman wrote: > >> I'm having some trouble building instrumented bundles when I use the > >> maven-scr-plugin. I get errors like: > >> > >> [FATAL ERROR] org.apache.felix.scrplugin.mojo.SCRDescriptorMojo#execute() > >> caused a linkage error (java.lang.NoClassDefFoundError) and may be > >> out-of-date. Check the realms: > >> [FATAL ERROR] Plugin realm = > >> app0.child-container[org.apache.felix:maven-scr-plugin:1.4.4] > >> > >> And: > >> > >> java.lang.NoClassDefFoundError: com/vladium/emma/rt/RT > >> > >> Has anyone set up a working build with maven-emma-plugin and > >> maven-scr-plugin? Any ideas why the class can't be found? > >> > >> On Fri, Jun 04, 2010 at 10:43:16AM -0400, D. Stuart Freeman wrote: > >>> OK, that makes sense. We don't use the default bundle list, so I think > >>> this will work. > >>> > >>> Thanks. > >>> > >>> On Fri, Jun 04, 2010 at 10:39:35AM -0400, Justin Edelson wrote: > >>>> launchpad:start doesn't actually use *anything* in the target directory. > >>>> > >>>> It sounds like you want to use instrumented bundles. This should be > >>>> possible if you install those bundles into your local maven repository > >>>> with a classifier and then use an alternate bundle list file which > >>>> specifies the classifier for the instrumented bundles. > >>>> > >>>> Due to the way that bundle list files are merged, you could only do this > >>>> for bundles you define, not those in the default bundle list (if you use > >>>> the default bundle list). > >>>> > >>>> Justin > >>>> > >>>> On 6/4/10 10:18 AM, D. Stuart Freeman wrote: > >>>>> Is it possible to configure the path the the jar that gets started by > >>>>> the > >>>>> maven-launchpad-plugin's start goal? I'd like it to start a jar that's > >>>>> instrumented by emma (in target/emma/) instead of the default one in > >>>>> target/. > >>>>> > >>>> > >>> > >>> -- > >>> D. Stuart Freeman > >>> Georgia Institute of Technology > >> > >> > >> > >> -- > >> D. Stuart Freeman > >> Georgia Institute of Technology > > > > > > > -- D. Stuart Freeman Georgia Institute of Technology
diff --git a/bundles/commons/json/pom.xml b/bundles/commons/json/pom.xml
index 975962e..69bfe53 100644
--- a/bundles/commons/json/pom.xml
+++ b/bundles/commons/json/pom.xml
@@ -54,6 +54,37 @@
</instructions>
</configuration>
</plugin>
+ <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>
</plugins>
</build>
signature.asc
Description: Digital signature
