title: Can I add a custom repository to gradle.properties?
body: <p>I'd like to be able to define a repository in settings (ideally user gradle.properties)</p>
  
  <p>The end goal is something like this:</p>
  
  <pre><code>repositories {
      mavenCentral() // Can't/don't want to use this
      nexusCentral() // Can use these - on network Nexus server
      nexusSnapshot()
  }
  </code></pre>
  
  <p>How would I go about doing this? Again, this would go in the user-level gradle.properties file ideally, so we don't have to reference it in every single module.</p>
  
  <p>This is just a plain maven style artifact repository provided by Maven, the manual way would be:</p>
  
  <pre><code>maven {
          url "http://path/to/nexus"
      }
  </code></pre>
  
  <p>One other requirement is the use of the "publish" task, which has credentials defined for a repository (that Jenkins uses to publish the module):</p>
  
  <pre><code>publishing {
  ...
  maven {
              url "http://path/to/nexus"
              // Jenkins provides these as -P Gradle parameters.
              credentials {
                  username = "${uploaderUser}"
                  password = "${uploaderPassword}"
              }
          }
  </code></pre>
  
  <p>These credentials would not be known to regular users, but would ideally be configured in Jenkin's gradle.properties. We wouldn't want users builds to fail because they can't resolve the credentials - they would never even use the "publish" task.</p>