title: Android gradle uploadArchives task issues on Jenkins
body: <p>I have a Jenkins job and one of the tasks executed is uploadArchives which should upload the generated .aar file to an Artifactory repo.</p>
  
  <p>However I see this error</p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
       What went wrong:
     Execution failed for task ':libmodule:uploadArchives'.
       Could not publish configuration 'archives'
          Error deploying artifact 'com.companyname:mylib:aar': Error deploying artifact: /var/empty/.m2/repository/com/companyname/mylib/1.0.0/mylib-1.0.0.aar (No such &gt;file or directory)
  
      Try:
      Run with --info or --debug option to get more log output.
  </code></pre>
  
  <p>Relevant parts of the build.gradle</p>
  
  <pre><code>repositories {
      maven{
          url 'http://artifacts.companyname.com/repository/android-shared-sandbox'
      }
  }
  
  def aarFile = file('build/libs/mylib.aar')
  artifacts {
      archives aarFile
  }
  
  //Specify the URL and credentials to deploy the aar to the maven repository
  
  uploadArchives {
      repositories {
          mavenDeployer {
            repository(url: "http://artifacts.companyname.com/repository/android-shared-sandbox"){
                 authentication(userName: "username", password: "changeme")
              }
              pom.project {
                 groupId 'com.companyname'
                 artifactId 'mylib'
                  packaging 'aar'
                 version  '1.0.0'
              }
         }
    }
   }
  </code></pre>
  
  <p>This works from the command line on my laptop, also works on a local jenkins install on my laptop. I assume I am missing something simple here, but I cannot figure out why Jenkins is attempting to install it into some local maven repo instead of the on specified by the build.gradle task</p>