title: ~/.gradle/gradle.properties file not being read
body: <p>There is a similar question here: <a href="https://stackoverflow.com/questions/26331397/gradle-properties-not-being-read-from-gradle-gradle-properties">Gradle properties not being read from ~/.gradle/gradle.properties</a> but it does not solve my problem.</p>
  
  <p>It seems to me that gradle is NOT reading my <code>~/.gradle/gradle.properties</code> file.</p>
  
  <p>I have a gradle.properties file in <code>~/.gradle</code>, and it has properties needed to sign artifacts before uploading to maven central. It looks like this:</p>
  
  <pre><code>signing.keyId=12345678
  signing.password=myPassword
  signing.secretKeyRingFile=/home/me/.gnupg/secring.gpg
  
  sonatypeUsername=me
  sonatypePassword=myOtherPassword
  </code></pre>
  
  <p>When I try to build my project, it complains that there's no sonatypeUsername property, thus:</p>
  
  <pre><code>&gt; Could not find property 'sonatypeUsername' on root project 'yourProject'.
  </code></pre>
  
  <p>Here's the relevant portion of my project's build.gradle:</p>
  
  <pre><code>uploadArchives {
      repositories {
          mavenDeployer {
  
              // lots of non-interesting things here
  
              repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
                  authentication(userName: project.property("sonatypeUsername"), password: project.property("sonatypePassword"))
              }
          }
      }
  }
  </code></pre>
  
  <p>When I try to build the project with debugging, here's what I see regarding properties:</p>
  
  <pre><code>$ ./gradlew --stacktrace --debug build
  
  [INFO] [o.g.BuildLogger] Starting Build
  [DEBUG] [o.g.BuildLogger] Gradle user home: /home/me
  [DEBUG] [o.g.BuildLogger] Current dir: /home/me/dev/yourProject
  [DEBUG] [o.g.BuildLogger] Settings file: null
  [DEBUG] [o.g.BuildLogger] Build file: null
  [DEBUG] [o.g.i.b.BuildSourceBuilder] Starting to build the build sources.
  [DEBUG] [o.g.i.b.BuildSourceBuilder] Gradle source dir does not exist. We leave.
  [DEBUG] [o.g.i.DefaultGradlePropertiesLoader] Found env project properties: []
  [DEBUG] [o.g.i.DefaultGradlePropertiesLoader] Found system project properties: []
  [DEBUG] [o.g.a.i.a.m.DefaultLocalMavenRepositoryLocator] No local repository in Settings file defined. Using default path: /home/me/.m2/repository
  [DEBUG] [o.g.i.ScriptEvaluatingSettingsProcessor] Timing: Processing settings took: 0.286 secs
  [INFO] [o.g.BuildLogger] Settings evaluated using empty settings script.
  [DEBUG] [o.g.i.ProjectPropertySettingBuildLoader] Looking for project properties from: /home/me/dev/yourProject/gradle.properties
  [DEBUG] [o.g.i.ProjectPropertySettingBuildLoader] project property file does not exists. We continue!
  [INFO] [o.g.BuildLogger] Projects loaded. Root project using build file '/home/me/dev/yourProject/build.gradle'.
  </code></pre>