Current Behavior
According to the documentation, system properties provided through the command-line should take priority over system properties coming in through user-level and project-level gradle.properties files.
In practice, this order is the inverse (and seems to have been for years) in the specific case of the gradle wrapper:
| SystemPropertiesCommandLineConverter converter = new SystemPropertiesCommandLineConverter(); | |
| converter.configure(parser); | |
| ParsedCommandLine options = parser.parse(args); | |
| Properties systemProperties = System.getProperties(); | |
| systemProperties.putAll(converter.convert(options, new HashMap<String, String>())); | |
| File gradleUserHome = gradleUserHome(options); | |
| addSystemProperties(systemProperties, gradleUserHome, rootDir); |
Can this behavior be made consistent?
Expected Behavior
Correct priority of system properties handling in the wrapper: command-line arguments should take precedence over gradle properties files.
Context (optional)
We are trying to migrate the resolution of our custom gradle distribution to a new remote repository, which requires a way to manually override authentication during this migration.
The old authentication is defined on our CI infrastructure as secrets injected into the agents, so would instantly apply everywhere, which prevents us from executing initial verification and gradual migration.
Self-contained Reproducer Project
Any gradle project that uses the wrapper can be used to reproduce.
Gradle version
9.2.1
Build scan URL (optional)
No response
Your Environment (optional)
No response