Hi Helko,
the provided example is very simple and considers all JARs under a
certain directory. You may traverse and filter your JAR files (e.g. only
application JARs) and feed them to the Analyzer.
Regards,
-marc
On 18.02.16 16:29, Helko Glathe wrote:
Hello,
I adapted the ReportGenerator example to use JaCoCo code coverage
report without Maven etc. in plain Java.
http://eclemma.org/jacoco/trunk/coverage/org.jacoco.examples/org.jacoco.examples/ReportGenerator.java.html
For the classes/bin option I referenced a folder where underneath all
plugins and classes folders are located to run the product we have.
Lots of them are from org.eclipse or org.apache.
For some of those 3rd party jar libs I get such problems when running
the JaCoCo analyzer:
Let's go with the JaCoCo integration test code coverage report!
3 JaCoCo exec files found.
Exception in thread "main" java.io.IOException: Error while analyzing
class
C:\Standalone\Workspace\products\plugins\org.apache.xmlbeans_2.3.0.v201405241900.jar@javax/xml/namespace/QName.class.
at org.jacoco.core.analysis.Analyzer.analyzerError(Analyzer.java:150)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:144)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:175)
at org.jacoco.core.analysis.Analyzer.analyzeZip(Analyzer.java:246)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:178)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:208)
at org.jacoco.core.analysis.Analyzer.analyzeAll(Analyzer.java:203)
at
jacocoreporter.ReportGenerator.analyzeStructure(ReportGenerator.java:142)
at jacocoreporter.ReportGenerator.create(ReportGenerator.java:98)
at jacocoreporter.ReportGenerator.main(ReportGenerator.java:163)
Caused by: java.lang.IllegalStateException: Can't add different class
with same name: javax/xml/namespace/QName
at
org.jacoco.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:106)
at org.jacoco.core.analysis.Analyzer$1.visitEnd(Analyzer.java:92)
at org.jacoco.asm.ClassVisitor.visitEnd(ClassVisitor.java:317)
at
org.jacoco.core.internal.flow.ClassProbesAdapter.visitEnd(ClassProbesAdapter.java:98)
at org.jacoco.asm.ClassReader.accept(ClassReader.java:697)
at org.jacoco.asm.ClassReader.accept(ClassReader.java:506)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:107)
at org.jacoco.core.analysis.Analyzer.analyzeClass(Analyzer.java:142)
... 8 more
when I remove those problematic jar lib files from the folder the
analyzer runs without problems.
Is there an option to ignore certain jar libs or does anybody have an
idea how else I can solve this problem?
Thanks in advance and kind regards.
Helko
--
You received this message because you are subscribed to the Google
Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/370dce60-9b12-44f6-92ee-8561cba841ad%40googlegroups.com
<https://groups.google.com/d/msgid/jacoco/370dce60-9b12-44f6-92ee-8561cba841ad%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "JaCoCo
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/56C9E7EB.7040708%40mountainminds.com.
For more options, visit https://groups.google.com/d/optout.