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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:30:31+00:00 2026-05-12T23:30:31+00:00

I need to create a WAR file that just contains static content files (gifs,

  • 0

I need to create a WAR file that just contains static content files (gifs, jpgs, html, js, etc). I have a directory structure that contains all the files and need to create the WAR file via an ANT (1.5.1) build task. Right now I just have this in the ANT task:

<war destfile="${output.file}" webxml="WEB-INF/web.xml" basedir="${basedir}">
    <fileset dir="${basedir}/sales" />       
</war>

The files I want to include are in C:/basedir/sales and its subdirectories. When I try to run this task I get “A zip file cannot include itself”. So clearly putting that fileset in there is not the right way to do it. I am unclear as to what I need to put in the task and in the web.xml file to specify what files to include within the archive.

  • 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-12T23:30:31+00:00Added an answer on May 12, 2026 at 11:30 pm

    I think the basedir=”${basedir}” is causing you the problems. Also, I think the way you have it written will require that web.xml exist inside WEB-INF dir relative to where you run ant from.

    So, try creating /WEB-INF/web.xml as follows:

    <?xml version="1.0" encoding="utf-8" ?>
    
    <web-app>
    </web-app>
    

    Then try updating /build.xml as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="yourproject" basedir="." default="war" xmlns:ivy="antlib:org.apache.ivy.ant">
            <target name="war" description="--> build war file">
                    <war destfile="./mywar.war" webxml="WEB-INF/web.xml">
                        <fileset dir="C:/basedir/sales" />
                    </war>
            </target>
    </project>
    

    Then you should be able to run “ant war” from command line and it should create “mywar.war” in your current directory.

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

Sidebar

Related Questions

I need to create some way to get a local WAR file deployed on
I have a war file (actually not my own, it's Apache ODE 1.2) that
I have created a mail.jar file and mywar.war file. What I need to set
I have dynamically created WrapPanel (_wp) with several Borders. And I need create handler
I am trying to export a WAR file from Eclipse. I have a Dynamic
I have an XML file which I need to read and load the data
Due project requirements, I need to create a webapp that, when executing, will allow
I think the question says most of it. I have an autogenerated ManualSpecRunner.html file
I have an EAR file which I create with maven, it's made up of
I need create a server side game loop, the problem is how to limit

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.