synchronizationTasks do not work with JDK21

We have been using such a build script:

eclipse {
    synchronizationTasks cleanEclipse, eclipseJdt
    if (jdt) {
        jdt.file.withProperties { property ->
            property['org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage'] = 'enabled'
        }
    }
}

This block adds org.eclipse.jdt.core.compiler.ignoreUnnamedModuleForSplitPackage=enabled to .settings\org.eclipse.jdt.core.prefs in order to bypass the java platform module system rules in Eclipse.

This works when importing the project in Eclipse with JDK17 but stopped working with JDK21.
The .settings\org.eclipse.jdt.core.prefs seems not to be created at all.

If I execute the eclipseJdt gradle task directly, the file is created properly but the use of the synchronizationTasks was to skip the task invocation before importing the project in Eclipse.

Any clues as to how to resolve this?

I am attaching two zip samples to demonstrate this problem:

broken-java21.zip (286.5 KB)

working-java17.zip (286.1 KB)

Steps I do:

  1. Edit gradle.properties file with the right JDK paths
  2. Open Eclipse and under Window → Preferences → JRE → configure that same JDK as in the properties file
  3. Import the Gradle project

Here is how it looks in Eclipse with JDK17:

Here is how it looks in Eclipse with JDK21: