cobertura maven插件NoClassDefFound错误

时间:2016-08-28 03:30:37

标签: java maven-cobertura-plugin

我试图将cobetura与maven整合。

每当我运行cobertura:cobertura我都会收到以下错误

2016-08-27 23:26:46.018:WARN:oejs.ServletHandler:qtp2124261761-22: Error for /test/order-received/
java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector
at com.merc.test.AppServlet.__cobertura_init(AppServlet.java)
at com.merc.test.AppServlet.<clinit>(AppServlet.java)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)

这是我对插件的设置

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>cobertura-maven-plugin</artifactId>
    <version>2.7</version>
    <configuration>
      <formats>
        <format>xml</format>
        <format>html</format>
      </formats>
      <instrumentation>
        <excludes>
        <exclude>com/merc/test/**/*Constants.class</exclude>
        <exclude>com/merc/test/**/constants/*</exclude>
        </excludes>
      </instrumentation>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>clean</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

0 个答案:

没有答案