Gradle.properties: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:
'gradle.properties' files are used to define configuration [[Gradle_Runtime_and_Project_Configuration#Overview|properties]].
'gradle.properties' files are used to define configuration [[Gradle_Runtime_and_Project_Configuration#Overview|properties]].


gradle.properties can be present in two layers: the [[#Gradle_User_Home_gradle.properties|user home directory .gradle directory]] and a project root.
gradle.properties can be present in two layers: the [[#Gradle_User_Home_gradle.properties|user home directory .gradle directory]] and the [[#Project_Root_gradle.properties|project root]].


If files from both layers are present, their content is merged and the configuration that comes from the user home directory takes precedence over the configuration that comes from the project root directory. This makes sense from a security perspective, as the user home directory is not checked in into a repository while the project is, and we need to store security sensitive configuration. The [[#Project_Root_gradle.properties|project root gradle.properties]] is important because it can be stored in source control, so the entire team working on the project can share the same configuration.
If files from both layers are present, their content is merged and the configuration that comes from the user home directory takes precedence over the configuration that comes from the project root directory. This makes sense from a security perspective, as the user home directory is not checked in into a repository while the project is, and we need to store security sensitive configuration. The [[#Project_Root_gradle.properties|project root gradle.properties]] is important because it can be stored in source control, so the entire team working on the project can share the same configuration.
=Hierarchy=
=Hierarchy=


=Gradle User Home gradle.properties=
==Gradle User Home gradle.properties==


This file is  stored in Gradle user home directory ~/.gradle/gradle.properties, conventionally referred to as GRADLE_USER_HOME.
This file is  stored in Gradle user home directory ~/.gradle/gradle.properties, conventionally referred to as GRADLE_USER_HOME.


=Project Root gradle.properties=
==Project Root gradle.properties==


Conventionally, this is where the version of the project is stored:
Conventionally, this is where the version of the project is stored:

Revision as of 05:24, 5 October 2020

Internal

Overview

'gradle.properties' files are used to define configuration properties.

gradle.properties can be present in two layers: the user home directory .gradle directory and the project root.

If files from both layers are present, their content is merged and the configuration that comes from the user home directory takes precedence over the configuration that comes from the project root directory. This makes sense from a security perspective, as the user home directory is not checked in into a repository while the project is, and we need to store security sensitive configuration. The project root gradle.properties is important because it can be stored in source control, so the entire team working on the project can share the same configuration.

Hierarchy

Gradle User Home gradle.properties

This file is stored in Gradle user home directory ~/.gradle/gradle.properties, conventionally referred to as GRADLE_USER_HOME.

Project Root gradle.properties

Conventionally, this is where the version of the project is stored:

version=1.0-SNAPSHOT