Search code examples
groovylogbacklogback-groovy

Does logback need groovy.jar or groovy-all.jar?


I'm looking to minimize the size of my software distribution, and groovy-all.jar is by far the biggest JAR. Groovy is used for logback configuration[1]. On the bottom of the Groovy download page there's a section on the split Groovy distribution.

Which modules / JAR files does logback need to function properly? Is just groovy.jar sufficient?

[1] Yes, I realize I could configure logback with XML, eliminating the need for Groovy support. That is not my question.


Solution

  • I haven't found a source, but as of logback version 1.0.13 my tests show that groovy-jsr223 is needed as well. If I import only groovy in my pom.xml, logback complains about missing classes. The error message is

    ERROR in ch.qos.logback.classic.LoggerContext[default] - Groovy classes are not available on the class path. ABORTING INITIALIZATION.

    My dependency configuration that works is:

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.0.13</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>2.5.8</version>
        <type>pom</type>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-jsr223</artifactId>
        <version>2.5.8</version>
        <type>pom</type>
        <scope>test</scope>
    </dependency>