Running Jetty with instrumented files (cobertura)
I've several Selenium tests and want to know their coverage (measured with Cobertura). I'm using Maven 2 as a build framewor开发者_StackOverflowk.
Before executing my Selenium tests, I launch the web application using mvn jetty:run
.
In order for the coverage data to appear in my report, I need Jetty to use instrumented code.
I can explicitly instrument the code using mvn cobertura:instrument
. But how can I tell Jetty to use the instrumented code (directory target/generated-classes/cobertura) ?
Thanks in advance
Dmitri
In the configuration element of the jetty-maven-plugin plugin entry, you can specify the element, which will cause it to use a different path to find the classes.
If you set you add the following to your jetty plugin element, I think you'll be in business:
<classesDirectory>${basedir}/target/generated-classes/cobertura</classesDirectory>
精彩评论