I'm using Gradle 3.1.2 and I have the following situation.
buildscript {
repositories {
maven { url repository }
}
...
In the gradle.properties
file the entry is
repository=https://my.url
I now want to move this property entry to the local.properties
file, since it should not be committed into vcs. But gradle
cannot seem to find it when it is in local.properties
.
Where do I need to place the property so gradle
can find it but its not in vcs.
The global properties file should be located in your home directory: On Windows: C:\Users\<you>\. gradle\gradle. properties.
Using the -D command-line option, you can pass a system property to the JVM which runs Gradle. The -D option of the gradle command has the same effect as the -D option of the java command. You can also set system properties in gradle. properties files with the prefix systemProp.
A Gradle project property is a property that can be accessed in your project's build. gradle and gets passed in from an external source when your build is executed.
Should you commit Gradle properties? properties is to keep it outside of version control, because team members may use it to customize builds, and it is not desirable to have them accidentally commit changes to that file.
As in https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties described you could use a grade.properties file in your GRADLE_USER_HOME directory (default $HOME/.gradle).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With