in my init.gradle i use EnterpriseRepositoryPlugin with System.properties['someValue'] which is discouraged due to configuration caching ( Configuration cache )
Now my issue is using providers.environmentVariable('someValue') inside void apply does not work, it cannot be accessed. On the global level in init.gradle it is accessible.
class EnterpriseRepositoryPlugin implements Plugin<Gradle> {
void apply(Gradle gradle) {
gradle.settingsEvaluated { settings ->
// old variant
// System.properties['someValue']
// not working
providers.environmentVariable('someValue')
}
}
}
Just in case someone still finds this post, Provider#forUseAtConfigurationTime() has been deprecated in Gradle 8, does nothing, and got removed from Gradle 9: