Search code examples
groovyjar

Where can I get groovy-all-4.0.0.jar?


Where can I get/download groovy-all-4.0.0.jar containing all the important Groovy 4.0 modules/classes in one file?

Till now I've found only a pom file, but I cannot use Maven.

https://repo1.maven.org/maven2/org/apache/groovy/groovy-all/4.0.0/groovy-all-4.0.0.pom


Solution

  • Go to Maven Central's search page:

    https://search.maven.org/

    Type groovy-all. Select the latest version. Click on "Browse" on the top-right.

    You'll get to this page:

    https://repo1.maven.org/maven2/org/apache/groovy/groovy-all/4.0.0/

    From here, you can copy the links to all jars and download that by clicking on it or using wget, curl or what have you.

    EDIT: the groovy-all module on Maven Central is now a POM module. This means it's just grouping all the Groovy jars (most of them, actually). As announced on the Groovy 2.5 release notes, the groovy-all jar is no longer published. That is, you're expected to use a tool like Maven, Gradle or Ivy to download the jars from the groovy-all Maven artifact (as the transitive dependencies must be downloaded as well).

    I suggest you use mvn dependency:get to download all the dependencies (unfortunately, it will only install the artifacts in the local maven repository instead of on a single directory like you probably want), or use Gradle like this:

    repositories {
      mavenCentral()
    }
    configurations {
      groovy
    }
    dependencies {
      groovy 'org.apache.groovy:groovy-all:4.0.0'
    }
    task downloadGroovy(type: Copy) {
      from configurations.groovy
      into file('groovy-jars')
    }
    

    Put this into a build.gradle file, then from the same directory, run gradle downloadGroovy. It will download all the jars into the groovy-jars directory.

    Notice, however, that this is almost certainly not what you want. You most likely should pick and choose which groovy jars you actually need and only download those.

    Here's the list of Jars I get when I use Gradle to download the jars:

    ant-1.10.12.jar                     groovy-datetime-4.0.0.jar           groovy-templates-4.0.0.jar          jline-2.14.6.jar
    ant-antlr-1.10.12.jar               groovy-docgenerator-4.0.0.jar       groovy-test-4.0.0.jar               junit-4.13.2.jar
    ant-junit-1.10.12.jar               groovy-groovydoc-4.0.0.jar          groovy-test-junit5-4.0.0.jar        junit-jupiter-api-5.8.2.jar
    ant-launcher-1.10.12.jar            groovy-groovysh-4.0.0.jar           groovy-xml-4.0.0.jar                junit-jupiter-engine-5.8.2.jar
    asm-9.2.jar                         groovy-jmx-4.0.0.jar                groovy-yaml-4.0.0.jar               junit-platform-commons-1.8.2.jar
    asm-analysis-9.2.jar                groovy-json-4.0.0.jar               hamcrest-core-1.3.jar               junit-platform-engine-1.8.2.jar
    asm-tree-9.2.jar                    groovy-jsr223-4.0.0.jar             ivy-2.5.0.jar                       junit-platform-launcher-1.8.2.jar
    asm-util-9.2.jar                    groovy-macro-4.0.0.jar              jackson-annotations-2.13.1.jar      opentest4j-1.2.0.jar
    groovy-4.0.0.jar                    groovy-nio-4.0.0.jar                jackson-core-2.13.1.jar             org.abego.treelayout.core-1.0.3.jar
    groovy-ant-4.0.0.jar                groovy-servlet-4.0.0.jar            jackson-databind-2.13.1.jar         picocli-4.6.2.jar
    groovy-cli-picocli-4.0.0.jar        groovy-sql-4.0.0.jar                jackson-dataformat-yaml-2.13.1.jar  qdox-1.12.1.jar
    groovy-console-4.0.0.jar            groovy-swing-4.0.0.jar              javaparser-core-3.24.0.jar          snakeyaml-1.28.jar
    

    This includes everything Groovy needs to run as a CLI, REPL, grab dependencies with Ivy, compile code at runtime etc. Do you need all that? If you do, then go ahead and use groovy-all, otherwise, it's advisable to look for the jars you actually are going to use.