Hi Konstantin,
I reduced this to a standalone project and verified it with Gradle 9.5.1 and Microsoft OpenJDK 21.0.7 on Windows. Both Jmix Gradle plugin 3.0.2 and 3.0.3 reproduce the failure.
The complete project sources are below. It needs only two empty Java classes; no entities, application dependencies, database, custom tasks, or init scripts are required.
settings.gradle:
rootProject.name = 'jmix-configuration-cache-reproducer'
build.gradle:
plugins {
id 'io.jmix' version '3.0.2'
id 'java'
}
jmix {
bomVersion = '3.0.2'
projectId = 'repro'
}
repositories {
mavenCentral()
maven { url = 'https://global.repo.jmix.io/repository/public' }
}
src/main/java/example/Example.java:
package example;
public class Example {
}
src/test/java/example/ExampleTest.java (plain Java class, no test framework needed):
package example;
public class ExampleTest {
}
Use a Gradle 9.5.1 wrapper (distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip). If needed, generate it with gradle wrapper --gradle-version 9.5.1 --distribution-type bin.
From the project directory, run these commands separately:
# Main enhancer: fails
.\gradlew.bat clean enhanceJmixMain --configuration-cache --no-build-cache --no-daemon --console=plain
# Test enhancer in isolation: fails
.\gradlew.bat clean enhanceJmixTest -x enhanceJmixMain --configuration-cache --no-build-cache --no-daemon --console=plain
# Control: both enhancers succeed
.\gradlew.bat clean enhanceJmixMain enhanceJmixTest --no-configuration-cache --no-build-cache --no-daemon --console=plain
On Linux/macOS, use ./gradlew instead. The -x enhanceJmixMain in the second command lets the test enhancer run without stopping first at the main enhancer failure.
For the main enhancer, the output is:
> Task :enhanceJmixMain FAILED
1 problem was found storing the configuration cache.
- Task `:enhanceJmixMain` of type `org.gradle.api.DefaultTask`: invocation of 'Task.project' at execution time is unsupported with the configuration cache.
Execution failed for task ':enhanceJmixMain' (registered by plugin 'io.jmix').
> Invocation of 'Task.project' by task ':enhanceJmixMain' at execution time is unsupported with the configuration cache.
Configuration cache entry discarded with 1 problem.
The isolated test command reports the same error for :enhanceJmixTest.
I repeated all three commands after changing both the plugin version and bomVersion to 3.0.3:
| Jmix version |
Main with configuration cache |
Test with configuration cache |
Both without configuration cache |
| 3.0.2 |
Fails: Task.project |
Fails: Task.project |
Passes |
| 3.0.3 |
Fails: Task.project |
Fails: Task.project |
Passes |
This isolates the build-time failure from the original multi-build repository. Does this give you enough to investigate configuration-cache support in the enhancer tasks?
Thanks,
Tom