Link to home
Start Free TrialLog in
Avatar of ambuli
ambuliFlag for United States of America

asked on

Gradle: Download a tar file from artifactory

Hi there,
I am new to gradle.  I have a tar file uploaded to JFrog artifactory under ext-snapshot-local and it is saved as test.ambuli-1.0.0.tar
I want to download this file and extract it.  I am not sure, how to refer to the file in the dependencies.


apply plugin: 'java'
apply plugin: 'maven-publish'


configurations {
    AmbuliTar
}


dependencies {
  AmbuliTar('') ????????
}



repositories {

   println 'doing repo'

   maven {
      def repName = "ext-snapshot-local"
      println "building from $repName using"
      
      credentials {
          username artifactoryUserDev
          password artifactoryUserDevPassword
      }   
      url "http://${artifactoryHost}:${artifactoryPort}/artifactory/$repName"
   }
   
}  


task extractTar {
   File myTarFile = configurations.getByName('AmbuliTar').singleFile
     if(myTarFile.exists()) {
         ant.unar(src: myTarFile, dest: file('myDest'))

   }

}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Prashant Sabnekar
Prashant Sabnekar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The question is idle and there are nobody participating anymore. So I am initiating auto close.