Where does gradle look for gradle.properties?


(Mark Petrovic) #1

The latest User Guide (v1.3) says that Gradle will look for gradle.properties in

“from gradle.properties located in gradle user home.”

I think that wording is a little ambiguous. Gradle looks in $HOME/.gradle/gradle.properties, which I believe is what that user guide phrasing tries to say.

Does anyone agree? If yes, maybe change the text in the user guide to say

‘from gradle.properties located in System.getProperty(“user.home”)/.gradle/gradle.properties’

or some such?

Here’s truss output showing where gradle looks on my machine:

$ grep stat.*gradle.properties build.log 65557/0x9f0671: stat64("/Users/petrovic/.gradle/gradle.properties\0", 0x10B9F9298, 0x400)

= -1 Err#2 65557/0x9f0671: stat64("/Users/petrovic/Projects/example/qa/gradle.properties\0", 0x10B9F9298, 0x400)

= -1 Err#2 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/gradle.properties\0", 0x1132CFF48, 0x400)

= 0 0 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/gradle.properties\0", 0x1132CFF30, 0x400)

= 0 0 65564/0x9f06a2: stat64("/Users/petrovic/.gradle/gradle.properties\0", 0x1132CFF48, 0x400)

= -1 Err#2 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/gradle.properties\0", 0x1132D0148, 0x400)

= 0 0 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/gradle.properties\0", 0x1132D0130, 0x400)

= 0 0 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/stagetests/gradle.properties\0", 0x1132D00D8, 0x400)

= -1 Err#2 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/geb-browser/gradle.properties\0", 0x1132D00D8, 0x400)

= -1 Err#2 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/cucumber-jvm-test/gradle.properties\0", 0x1132D00D8, 0x400)

= -1 Err#2 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/testng-support/gradle.properties\0", 0x1132D00D8, 0x400)

= -1 Err#2 65564/0x9f06a2: stat64("/Users/petrovic/Projects/example/qa/prod/automated-testing-framework/gradle.properties\0", 0x1132D00D8, 0x400)

= -1 Err#2

Thanks.


(Peter Niederwieser) #2

The wording is correct. It looks in the Gradle user home, which defaults to ‘$HOME/.gradle’.


(Mark Petrovic) #3

I see it now. Thanks.