maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cortes <>
Subject Re: Maven && Coverage on Application Server (Glassfish)
Date Tue, 05 Jun 2012 16:15:17 GMT
Now I added to my pom.xml the logic to instrument my classes and after mvn
package I produce my .ear that I want to deploy on my application server.

After mvn package I can see that my classes are instrumented .
Now I'm looking for this:

3.11. How do I use EMMA in {WebLogic, Websphere, Tomcat, JBoss, ...}?
First of all, there is little chance that you will be able to use the
on-the-fly mode (emmarun) with a full-blown J2EE container. The reason lies
in the fact that many J2EE features require specialized classloading that
will happen outside of EMMA instrumenting classloader. The server might run
fine, but you will likely get no coverage data.
Thus, the correct procedure is to instrument your classes prior to
deployment (offline mode). Offline instrumentation always follows the same
compile/instrument/package/deploy/get coverage/generate reports sequence.
Follow these steps:
use EMMA's instr tool to instrument the desired classes. This can be done as
a post-compilation step, before packaging. However, many users also find it
convenient to let EMMA process their jars directly (either in-place, using
overwrite mode, or by creating separate instrumented copies of everything,
in fullcopy mode);
do your J2EE packaging as normal, but do not include emma.jar as a lib at
this level, that is, within your .war, .ear, etc;
locate whichever JRE is used by the container and copy emma.jar into its
<jre dir>/lib/ext directory. If that is impossible, add emma.jar to the
server classpath (in a server-specific way);
deploy your instrumented classes, .jars, .wars, .ears, etc and exercise/test
your J2EE application via your client-side testcases or interactively or
whichever way you do it;
to get a coverage dump file, you have three options described in What
options exist to control when EMMA dumps runtime coverage data?. It is
highly recommended that you use coverage.get control command with the ctl
tool available in v2.1.

So I have downloaded emma.jar and copied it in lib/ but if I lunch my simple
application on glassfish (Hello World) and then I stop the application
server I can't see any files for coverage..


View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message