java - Cobertura instrument war -
i attempting instrument wars cobertura 1.9.4.1. this, use following ant task, invoked using maven-antrun-plugin:
<target name="instrumentear"> <cobertura-instrument todir="${module}/target/${ear.dir}"> <includeclasses regex="nl.*" /> <fileset dir="${module}/target/${ear.dir}"> <include name="**/*.war"/> </fileset> </cobertura-instrument> </target>
upon execution output is:
[info] --- maven-antrun-plugin:1.3:run (instrument) @ my-ear --- [info] executing tasks instrumentear: [cobertura-instrument] cobertura 1.9.4.1 - gnu gpl license (no warranty) - see copyright file [cobertura-instrument] instrumenting 2 files d:\workspace\my-ear\target\my-ear-1.0.0-snapshot [cobertura-instrument] cobertura: error closing output stream. [cobertura-instrument] java.util.zip.zipexception: zip file must have @ least 1 entry [cobertura-instrument] @ java.util.zip.zipoutputstream.finish(zipoutputstream.java:304) [cobertura-instrument] @ java.util.zip.deflateroutputstream.close(deflateroutputstream.java:146) [cobertura-instrument] @ java.util.zip.zipoutputstream.close(zipoutputstream.java:321) [cobertura-instrument] @ net.sourceforge.cobertura.util.ioutil.closeoutputstream(ioutil.java:165) [cobertura-instrument] @ net.sourceforge.cobertura.instrument.main.addinstrumentationtoarchive(main.java:319) [cobertura-instrument] @ net.sourceforge.cobertura.instrument.main.parsearguments(main.java:488) [cobertura-instrument] @ net.sourceforge.cobertura.instrument.main.main(main.java:514) [cobertura-instrument] cobertura: error closing output stream. [cobertura-instrument] java.util.zip.zipexception: zip file must have @ least 1 entry [cobertura-instrument] @ java.util.zip.zipoutputstream.finish(zipoutputstream.java:304) [cobertura-instrument] @ java.util.zip.deflateroutputstream.close(deflateroutputstream.java:146) [cobertura-instrument] @ java.util.zip.zipoutputstream.close(zipoutputstream.java:321) [cobertura-instrument] @ net.sourceforge.cobertura.util.ioutil.closeoutputstream(ioutil.java:165) [cobertura-instrument] @ net.sourceforge.cobertura.instrument.main.addinstrumentationtoarchive(main.java:319) [cobertura-instrument] @ net.sourceforge.cobertura.instrument.main.parsearguments(main.java:488) [cobertura-instrument] @ net.sourceforge.cobertura.instrument.main.main(main.java:514) [cobertura-instrument] cobertura: saved information on 0 classes. [cobertura-instrument] instrument time: 67ms
it seems ant unable read wars have been created maven. can remember long time ago had problems java zip implementation , used 1 ant. similar happening here, reversed?
this thread suggests should work, people recommend extracting wars first before instrumenting.
has had success ant task (cobertura-instrument) instrument wars in place?
i've solved instrumenting class files different projects included in war seperately , merging them directory application server started.
i instrumented individual projects coverage per project, merge action needed be added.
so no need instrument war.
Comments
Post a Comment