Unit tests passing through Maven, but failing through Cobertura: “Expecting a stackmap frame at branch target 65”

前端 未结 2 1599
滥情空心
滥情空心 2021-02-12 15:32

I recently added the Cobertura plugin to my Java/Spring-MVC project. The strange thing is that all my unit tests were passing, and they still pass when Maven does its initial t

2条回答
  •  抹茶落季
    2021-02-12 15:47

    Of course I find the answer right after asking the question, even though I searched for quite awhile before...

    The problem is that Cobertura has trouble working with Java 1.7. You must add the following line to your pom.xml:

    -XX:-UseSplitVerifier
    

    That goes in the configuration element. Here is the entire Cobertura section:

         
            org.codehaus.mojo
                cobertura-maven-plugin
                2.5.1
                
                    -XX:-UseSplitVerifier
                    
                        xml
                    
                
                
                    
                        test
                        
                            cobertura
                        
                    
                
           
    

    Now everything works as expected.

提交回复
热议问题