Skip to content

JUnit redistributable library was removed in Gradle 9+ #11

@donbex

Description

@donbex

Presumably due to the move to Groovy 4, Gradle distributions from version 9 onwards do not ship with a JUnit JAR any more, causing groovyw to fail with:

Exception in thread "main" java.lang.RuntimeException: Could not locate the JAR for junit in Gradle distribution '/Users/alessandro.pezzoni/.gradle/wrapper/dists/gradle-9.2.0-bin/11i5gvueggl8a5cioxuftxrik/gradle-9.2.0'.
        at org.gradle.wrapper.GroovyBootstrapMainStarter.findJars(GroovyBootstrapMainStarter.java:49)
        at org.gradle.wrapper.GroovyBootstrapMainStarter.start(GroovyBootstrapMainStarter.java:31)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:103)
        at org.gradle.wrapper.GroovyWrapperMain.main(GroovyWrapperMain.java:60)

Simply removing the relevant line from GroovyBootstrapMainStarter seems to be sufficient to get it to work again, although I do not know whether this is bound to cause any issues.

urls.add(findJars("junit", gradleHome, "lib").get(0));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions