You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JFrog plugin calls BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile, which in turn calls props.putAll(System.getProperties()); at Gradle configuration phase when configuration caching is enabled.
This makes every system property a configuration cache input, so if any property changes and the rest of the configuration does not read this value, configuration cache entry will be invalidated anyway.
For example, in certain cases Gradle sets idea.io.use.nio2 property, nothing in the configuration phase reads this value except 'com.jfrog.artifactory' plugin and that means if that property changes, configuration cache is invalidated.
Unfortunately Gradle does change the property idea.io.use.nio2 every time it re-compiles build.gradle.kts, which means that configuration cache is not usable for a second run.
Current behavior
Clip of configuration cache report:
On first run
$ ./gradlew tasks --configuration-cache
Calculating task graph as configuration cache cannot be reused because file 'build.gradle.kts' has changed.
..
On second run
$ ./gradlew tasks --configuration-cache
Calculating task graph as configuration cache cannot be reused because system property 'idea.io.use.nio2' has changed.
..
Reproduction steps
In a project with jfrog artifactory plugin configured:
Modify build.gradle.kts to force Gradle to recompile it.
Run ./gradlew tasks --configuration-cache twice.
First run ends with Configuration cache entry stored. output from Gradle.
Expected behavior
Second run of Gradle command, the Configuration cache entry reused. output is expected.
Artifactory Gradle plugin version
5.2.0
Operating system type and version
Ubuntu 22
JFrog Artifactory version
No response
Gradle version
8.6
The text was updated successfully, but these errors were encountered:
As per customer ,
The evaluation of system properties should be moved from the Gradle configuration phase to the execution phase. This can be accomplished in Gradle if you use a Provider<> and pass it to tasks inputs, instead of evaluating it in the configuration phase by calling Provider.get(). In this case, Gradle will not record that all system properties were an input for the configuration phase.
You may consider reading only the properties that you are interested in, not all of them. In this case, only those properties will be treated as an input. By doing so, the issue will be also solved.
Describe the bug
JFrog plugin calls
BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile
, which in turn callsprops.putAll(System.getProperties());
at Gradle configuration phase when configuration caching is enabled.This makes every system property a configuration cache input, so if any property changes and the rest of the configuration does not read this value, configuration cache entry will be invalidated anyway.
For example, in certain cases Gradle sets
idea.io.use.nio2
property, nothing in the configuration phase reads this value except 'com.jfrog.artifactory' plugin and that means if that property changes, configuration cache is invalidated.Unfortunately Gradle does change the property
idea.io.use.nio2
every time it re-compilesbuild.gradle.kts
, which means that configuration cache is not usable for a second run.Current behavior
Clip of configuration cache report:
On first run
On second run
Reproduction steps
In a project with jfrog artifactory plugin configured:
build.gradle.kts
to force Gradle to recompile it../gradlew tasks --configuration-cache
twice.Configuration cache entry stored.
output from Gradle.Expected behavior
Second run of Gradle command, the
Configuration cache entry reused.
output is expected.Artifactory Gradle plugin version
5.2.0
Operating system type and version
Ubuntu 22
JFrog Artifactory version
No response
Gradle version
8.6
The text was updated successfully, but these errors were encountered: