title: How to upload an existing collection of 3rd-party Jars to a Maven server in Gradle?
body: <p>How can I upload a collection of existing Jars to a Maven repository? The Jars are built from an ANT Task imported to Gradle, and used as a dependency to my task... The Jars don't have version tag, so they should ALL receive the same version number when they are uploaded... </p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'maven' 
  
  version = "6.1.1"
  group = "com.oahu" 
  
  ant.importBuild "$projectDir/tools/ant/package.xml" 
  
  uploadArchives(dependsOn: ["oahu-jar", "client-sdk-jar", "common-jar"]) &lt;&lt; { 
      // the dependencies will generate "oahu.jar", "oahu_client_sdk.jar", "common.jar" 
  
      // UPLOAD THE DEPENDENCIES LISTED ABOVE LOCATED AT the subdirectory "build/" 
  
      description = "Uploads the generated jar ${archivesBaseName}-${version}.jar to ${cn_mvn_serverUrl}" 
      repositories.mavenDeployer { 
         repository(url: "${cn_mvn_releaseUrl}") { 
            authentication(userName: "${cn_mvn_username}", password: "${cn_mvn_password}") 
         } 
      } 
  }
  </code></pre>
  
  <p>The tasks "oahu-jar", "client-sdk-jar", "common-jar" are the ones imported from ANT... I have the Maven repositories configuration already working from another project... But the Maven plugin uploads the Jar generated by the Jar task from the Java plugin... Considering the imported ANT tasks generates:</p>
  
  <ul>
  <li>build.gradle</li>
  <li>src</li>
  <li>build
  |-"oahu.jar"
  |-"oahu_client_sdk.jar"
  |-"common.jar"</li>
  </ul>
  
  <p>The result of this should be the upload of those Jars with the given version...</p>
  
  <p>"oahu-6.1.1.jar", "oahu_client_sdk-6.1.1.jar", "common-6.1.1.jar"... all uploaded to the Maven repository... </p>
  
  <p>Add sourceSets? Configuration? Artifacts?</p>