title: Giving gradle credentials for uploadArchives at build time
body: <p>I have a gradle project with several subprojects - all of which I want to be able to publish at once to a local artifactory repository. This is quite happily managed with uploadArchives. However, uploading requires credentials which I don't want to have stored anywhere. I've found several hacky ways of achieving this with setting extra properties as part of the root project and picking them up in subprojects, but it feels like the correct way to do this is something along the lines of:</p>
  
  <pre><code>task getAuth &lt;&lt; {
      ext {
          username = getUsername()
          password = getPassword()
      }
  }
  
  uploadArchives.dependsOn(getAuth)
  </code></pre>
  
  <p>However, uploadArchives appears to be run before it's dependency, hence the auth is set before username or password is set and the script errors out. This seems like exceedingly unexpected behaviour to me.</p>