Skip to content

'gradle fxJar' fails on Gradle 6.5, Gradle 5.6.4, but succeeds for Gradle 4.10.3 #718

@meltingscales

Description

@meltingscales

gradle fxJar using Gradle 6.5, 5.6.4 will fail with:

PS C:\Users\Henry\Github\ShootOFF> gradle fxJar
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Henry\Github\ShootOFF\build.gradle' line: 216

* What went wrong:
A problem occurred evaluating root project 'ShootOFF'.
> Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 14s

But it works with Gradle 4.10.3:

PS C:\Users\Henry\Github\ShootOFF> gradle fxJar

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 1s
13 actionable tasks: 13 up-to-date

I suspect this is because Gradle 4+ removed the 'classesDir' property and replaced it with 'classesDirs'.

Source: https://stackoverflow.com/questions/54707148/gradle-could-not-get-unknown-property-classesdir-for-main-classes

Maybe mention this in the README or Wiki?

Java version

C:\Users\Henry>javac -version
javac 1.8.0_221

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions