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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:02:08+00:00 2026-05-27T14:02:08+00:00

I have some test data with some special content (images, videos, etc.) in my

  • 0

I have some test data with some special content (images, videos, etc.) in my Grails 2 application that should not be included when building the war. At development time, these files are stored in web-app/content/. So the question is, how do I exclude them when build a war for the production environment?

During my search I came accross this blog post, covering the topic in an earlier Grails version. Unfortunately it doesn’t seem to work anymore and the comments didn’t help me either.

This is what I have tried for now:

grails.war.resources = { stagingDir ->
    delete { fileset(dir: "${stagingDir}/content/", includes: '*') }
}

Maybe I am just missing something? Or is there even a better way to separate test-data from shipping the application?

  • 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-27T14:02:09+00:00Added an answer on May 27, 2026 at 2:02 pm

    Yeah, I was obviously missing something. Or to be more precise sometimes less information is more. After a bit more of googling for ant delete fileset I saw that the includes attribute is deprecated. After leaving it out, all files in the content directory were removed. Even the directory structure is still present, which is exactly what I wanted.

    So my solution for now is:

    grails.war.resources = { stagingDir ->
        delete { fileset dir: "${stagingDir}/content/" }
    }
    

    EDIT:
    As far as I know grails uses ant under the hood, so the Ant Delete Task is the thing to look at. So I guess if you want to delete the empty subdirectories too, it would be (not checked though):

    delete(includeEmptyDirs: true) { fileset dir: "${stagingDir}/content/" }
    

    or if u want to delete the content folder itself just:

    delete(dir: "${stagingDir}/content/")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that attempts to test whether my application is running with
Does SQL Server have some test schema with data like customers, orders, etc to
I have a pre-constructed array created from some test data as I have not
I have some test cases. The test cases rely on data which takes time
I have some unit tests I've written to test my Django application. One test
I would like to populate my mongo with some test data. I have defined
I have some data (E.g.: 'acs24','45','ds' etc). Using this data I have the following
I would like to insert some test data while I start my application after
I have a Tapestry application, that retrieves data from a form, writes it to
I have some directories containing test data, typically over 200,000 small (~4k) files per

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.