Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-1254

Add Ant dependendency to com.cenqua.clover:clover maven artifact

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Won't Fix
    • Affects Version/s: 3.1.10
    • Fix Version/s: someday
    • Component/s: Groovy
    • Labels:
      None
    • Symptom Severity:
      Severity 3 - Minor

      Description

      Problem occurs in Gradle framework. When developer declares dependency to Clover artefact and tries to instrument project with Clover, it fails with a not-very-informative error:

      [clover-setup] Detected groovyc compiler org.codehaus.groovy.ant.Groovyc
        [groovyc] Compiling 1 source file to .......
        [groovyc] ERROR: Clover-for-Groovy encountered an error while loading config:
      

      Debug logging reveals more information:

        [groovyc] ERROR: Clover-for-Groovy encountered an error while loading config: Clover-for-Groovy encountered an error while loading config:  : org/apache/tools/ant/BuildException
        [groovyc] java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
        [groovyc] 	at java.lang.Class.getDeclaredFields0(Native Method)
        [groovyc] 	at java.lang.Class.privateGetDeclaredFields(Unknown Source)
        ...
        [groovyc] 	at com.atlassian.clover.instr.java.InstrumentationConfig.loadFromStream(InstrumentationConfig.java:439)
        [groovyc] 	at com.atlassian.clover.instr.groovy.Grover.newConfigFromResource(Grover.java:241)
        [groovyc] 	at com.atlassian.clover.instr.groovy.Grover.<init>(Grover.java:210)
      

      A reason is that normally this code is being called from Ant so the ant.jar is provided. In Gradle it's not available by default.

      Workaround: add ant.jar dependency in the project build file.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mparfianowicz Marek Parfianowicz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: