Quoting FAQ entry "Why do I get an error "ClassNotFoundException: org.jacoco.agent[...]Offline"?" at http://www.eclemma.org/jacoco/trunk/doc/faq.html :
If you use offline instrumentation the instrumented classes get a direct dependency on the JaCoCo runtime. Therefore jacocoagent.jar of the same JaCoCo version must be on the classpath and accessible from by the instrumented classes. In other words - you probably forgot to add a dependency. Also you can check our example of offline instrumentation - http://www.eclemma.org/jacoco/trunk/doc/examples/build/pom-offline.xml On Wednesday, October 26, 2016 at 12:49:45 PM UTC+2, [email protected] wrote: > > I have a maven project .I added the following to the pom.xml : > <plugin> > <groupId>org.jacoco</groupId> > <artifactId>jacoco-maven-plugin</artifactId> > <version>0.7.6.201602180812</version> > <executions> > <execution> > <id>jacoco-instrument</id> > <phase>test</phase> > <goals> > <goal>instrument</goal> > </goals> > </execution> > </executions> > </plugin> > > > when I do mvn clean install , I get > > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.NoClassDefFoundError: > org/jacoco/agent/rt/internal_14f7ee5/Offline > at > org.apache.atlas.fs.model.FSDataModelGenerator.$jacocoInit(FSDataModelGenerator.java) > at > org.apache.atlas.fs.model.FSDataModelGenerator.main(FSDataModelGenerator.java) > ... 6 more > Caused by: java.lang.ClassNotFoundException: > org.jacoco.agent.rt.internal_14f7ee5.Offline > at java.net.URLClassLoader.findClass(URLClassLoader.java:381) > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > ... 8 more > > How to resolve ? > > -- 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/25e59c10-bafe-4986-9f3e-e44601523cd5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
