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 6543847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:23:43+00:00 2026-05-25T11:23:43+00:00

I am trying to create a Zip task that would create a distribution package

  • 0

I am trying to create a Zip task that would create a distribution package for my project that contains project jar files and war (and potentially other build artifacts produced by the assemble task).

So I tried writing this simple script

task dist(dependsOn: 'assemble', type: Zip){
  into('lib'){
    from 'build/libs' //contains jar and war files
  }
  ... //other stuff
}

Task dist depends on assemble because it conveniently includes the tasks that create jar and war files.

But if I try to execute that, gradle complains with this error message:

Circular dependency between tasks. Cycle includes [task ':assemble', task ':dist'].

I’ve checked out the specification for assemble task, and it is clearly written that assemble task automatically dependsOn all archive tasks in the project, which obviously includes my dist task. And there seems to be no way to get around it.

What would be the correct way of doing this in gradle? How can I make a zip task that depends on assemble task? I could make dist task explicitly depend on jar and war tasks, but I think that kind of violates encapsulation a bit.

I am using gradle-1.0-milestone-3.

Thanks in advance!

  • 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-25T11:23:44+00:00Added an answer on May 25, 2026 at 11:23 am

    here is a complete example to depend your Zip on the jar and the war task:

    task dist(type:Zip){
        from jar.outputs.files
        from war.outputs.files
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a distributable zip of my project that contains several configuration
I have a project whereby I'm trying to create a distribution zip file, which
I'm trying to create a Zip file from .Net that can be read from
Trying to create my first iPhone app that would play back audio. When I
I'm trying to create a method which continually streams a zip file as a
I am trying create a WCF service that leverages the WPF MediaPlayer on the
I am trying to create a zip file using servlets but it returns me
I am trying to create a zip file and save it using DotNetZip library.
I'm trying to create a custom route like: search/result/city/p1/state/p2/zip/p3/min/p4/max/p5/bed/p6/bath/p7/cats/p8/dogs/p9/parking/p10 Where search is the controller
I'm trying to create a simple Clamp (so that I can bound the values

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.