gradlewebsphere-libertyopen-liberty

Getting "Failed to notify project evaluation listener" using Liberty Gradle plugin


With a simple Open Liberty project like one generated using the starter website (https://start.openliberty.io/) I get the following error on gradle build:

$ gradle build

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'app-name'.
> Failed to notify project evaluation listener.
   > groovy/lang/GroovyObject.getProperty(Ljava/lang/String;)Ljava/lang/Object;

* 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

My build.gradle has this:

plugins {
    id 'war'
    id 'io.openliberty.tools.gradle.Liberty' version '3.6.2'
}

I'm using Gradle v6.9.1 and Java 11.


Solution

  • EXPLANATION

    Starting with the Liberty Gradle plugin version 3.6, Gradle v7.3 or higher is required.

    You can either:

    SOLUTION

    In the case where you already have a Gradle wrapper of an older version you might even need to do something like:

    1. Downgrade the Liberty Gradle plugin version to v3.5.2
    2. Generate a newer wrapper, e.g.: ./gradlew wrapper --gradle-version=7.4.2
    3. Upgrade the Liberty Gradle plugin version (e.g. back to v3.6).

    (You might need to do this because otherwise the ./gradlew wrapper command will fail with the same, original error).