項目使用SSH框架,使用jacoco收集單元測試覆蓋率,遇到以下問題:java
[ERROR][org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer][Line:165] Javassist Enhancement failed: xxx框架
java.lang.VerifyError: (class: xxx_$$_javassist_4, method: <clinit> signature: ()V) Illegal local variable numbermaven
... ...ide
[WARN][org.hibernate.tuple.entity.PojoEntityTuplizer][Line:200] could not create proxy factory for:單元測試
org.hibernate.HibernateException: Javassist Enhancement failed測試
緣由是jacoco會instrument hibernate生成的代理類,在jacoco的plugin中配置exclude信息就行了spa
<plugin>hibernate
<groupId>org.jacoco</groupId>代理
<artifactId>jacoco-maven-plugin</artifactId>it
<version>0.6.3.201306030806</version>
<executions>
<execution>
<id>JaCoCo Agent</id>
<phase>test-compile</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<excludes>
<exclude>com/**/*_javassist_*</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>JaCoCo Report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>