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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:48:54+00:00 2026-06-18T10:48:54+00:00

I am making a war of a project but i want that classes within

  • 0

I am making a war of a project but i want that classes within that war be picked from specified location and also a jar file A.jar to be picked from custom location i am doing something like this ….

<target name="war" depends="a-jar">
    <war destfile="D:/JBOSSHOME/project.war" webxml="${project-location}/web/WEB-INF/web.xml">
        <fileset dir="${project-location}/web" >
        <exclude name="${project-location}/web/WEB-INF/lib/A.jar"/>
        <exclude name="${project-location}/web/WEB-INF/classes/**/*.class"/> 
        </fileset>
        <lib dir="${jarsLocation}"></lib>
        <classes dir="D:/JBOSSHOME/project/build/classes"/>
    </war>
</target>

but in the resultant war i am getting 2 A.jar files and also classes are getting copied from ${project-location}/web/WEB-INF/classes instead of the classes dir that i have provided…
Any help would be much appreciated…

  • 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-06-18T10:48:55+00:00Added an answer on June 18, 2026 at 10:48 am

    The exclude shouldn’t include the root directory of your file set:

    <fileset dir="${project-location}/web" >
        <exclude name="WEB-INF/lib/A.jar"/>
        <exclude name="WEB-INF/classes/**/*.class"/> 
    </fileset>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used the war command in Grails for making war file, but I got
I am generating xlsx file using Apache POI. On making the war and deploying
I am trying to export a WAR file from Eclipse. I have a Dynamic
So I have a java project in Eclipse. I build the war file via
Is there anyone who has succeeded in making a self-contained .war file using Tomcat
Possible Duplicate: Ignore SVN files when exporting a WAR file from Eclipse? Using eclipse
I use the jstl library in my project, but as an external jar. After
I have a project structure which is like Parent |-- child Project1 (Making war
I have an EAR file with a nested EJB project, a .war dynamic web
I have a project that i test, compile and build the war-package for it

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.