Apache Tomcat Maven Plugin
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-208

JaCoCo instrumentation errors when running StandaloneWarMojo


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: tomcat7
    • Labels:


      We've run into issues with using the plugin with jacoco for code coverage getting instrumentation errors on classes (saying they've already been instrumented). We found that this was due to how the exec-war and standalone-war goals work because they fork and start a new package phase (at least from what I've read that's what they're doing), so it's getting executed twice and the second time when it tries to instrument the classes it gets the errors. I found this doesn't occur with the exec-war-only goal, so I updated the StandaloneWarMojo class to not have the @Execute(phase = LifeCyclePhase.PACKAGE) annotation on it and that appeared to resolve the issue. Not sure if it would make more sense to add another goal such as 'standalone-war-only' and keep the existing standalone-war or not.

      1. StandaloneWarMojo.java.patch
        0.8 kB
        Tim Astle
      2. tomcat-maven-plugin.patch
        3 kB
        Tim Astle


        Tim Astle created issue -
        Tim Astle made changes -
        Field Original Value New Value
        Attachment StandaloneWarMojo.java.patch [ 12569833 ]
        Olivier Lamy (*$^¨%`£) made changes -
        Fix Version/s 2.1 [ 12320767 ]
        Component/s tomcat6 [ 12316300 ]
        Tim Astle made changes -
        Attachment tomcat-maven-plugin.patch [ 12569887 ]
        Olivier Lamy (*$^¨%`£) made changes -
        Component/s tomcat6 [ 12316300 ]
        Olivier Lamy (*$^¨%`£) made changes -
        Comment [ AFAIK tomcat6 support embedding too. ]
        Olivier Lamy (*$^¨%`£) made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]


          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Tim Astle
          • Votes:
            0 Vote for this issue
            4 Start watching this issue


            • Created: