Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6858469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:09:47+00:00 2026-05-27T02:09:47+00:00

My project has a remote dependency which is really just a zip of certain

  • 0

My project has a remote dependency which is really just a zip of certain files, which needs to be unzipped somewhere, so that the build can generate new java sources from the files. (I’m speaking generically to focus on the core problem and not on the specifics)

I wouldn’t expect this to be so hard, but I’ve been unable to get it working. Here’s what I’ve created:

I defined a new configuration:

configurations {
    newConf
}

Later, I’ve defined a single dependency for this confiuguration. It resolves to the zip file I need to explode:

dependencies {
    newConf "group:name:version@zip"
}

So far this all smells correct to me, though if anybody disagrees, I’m listening.

Lastly I need to define a task that explodes the zip into a directory, which then becomes the input for a later code-generation command.

task explodeModel {
    description = "unzip model into the specified 'modelSrc' directory"

    //input is a "files" collection (usually just one:  the zip)
    //output is the specified modelSrc dir

    File modelSrc = new File("$buildDir/modelSrc")
    outputs.files modelSrc

    doLast {
        configurations.newConf.allArtifacts.each { artifact -> println artifact }
    }

}

Obviously doLast isn’t unzipping anything just yet, I’m just trying to get an absolute path to the zipfile itself, and thats where I’m stuck. I have no idea how to get a path to the file so I can unzip it. Any help?

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:09:47+00:00Added an answer on May 27, 2026 at 2:09 am

    I did something similar in a plugin that I wrote. This should work for you:

    configurations.newConf.singleFile
    

    The assumption is that there’s only one file. The return type is java.io.File.
    For more information check this class GaePlugin.groovy. The method of relevance is configureDownloadSdk. The task that does the unzip is GaeDownloadSdkTask.groovy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an iPhone project in which the developer that created it has
Our project has one folder that is not part of the solution. How can
My project has multiple themes with different colors. I need to skin certain textboxes
My Project has 2 java files (A.java and B.java in same package). A.java uses
A Project has multiple Tasks, which has multiple Assignments Projects (1-n) -> Tasks (1-n)
So right now my project has a few custom dialogs that do things like
Assume that the core project has a base entity and every plugin maybe extends
I am adding a dependency to my Grails Project which brings in both commons-logging
Our project has a couple of remote subrepos in it, and their addresses have
I am working on a project that involves an embedded system which runs a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.