Search code examples
gradleartifactory

How can I downloand .zip dependency via gradle?


I want to download not-jar file from repository. I want to do it via task. I have this code but it does nothing when I call the function.

repositories {
   maven {
      url: abc.com
   }
}

configurations { archives { transitive = false } }
dependencies { archives "group:programm:version1" } // this file exists in abc.com with .zip extension 

task getArchives(type: Sync){
   from configurations.archives
   into "dest_dir"
}

abc.com is artifactory, but don't think that it is relevant


Solution

  • Below is a working example, you can change the task to your extract.

    configurations {
        zipDist
    }
    
    dependencies {
        zipDist 'org.apache.openejb:javaee-api:6.0-6@zip'
    }
    
    task testZip(type: Zip) {
        from configurations.zipDist
    }
    
    artifacts {
        zipDist testZip
    }