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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:56:41+00:00 2026-05-24T21:56:41+00:00

How to build jar using ant without META-INF folder? I have not specified any

  • 0

How to build jar using ant without META-INF folder? I have not specified any manifest attribute in:

<jar destfile="${build}/${jar}/${client}.jar" basedir="${build}/${classes}/${main}">
    <fileset file="${src}/${main}/application-context.xml" />
    <fileset file="${src}/${main}/log4j.xml" />
</jar>

But the jar file containing META-INF folder. Is there any way to exclude this folder’s creation?


Edit:

The complete build.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== 
     Aug 14, 2011 6:25:15 PM                                                                           
     Tanmoy                                                                
    ====================================================================== -->
<project name="Number">
    <description>
        Number
    </description>

    <property name="lib" value="lib" />
    <property name="src" value="src" />
    <property name="build" value="build" />
    <property name="classes" value="classes" />
    <property name="jar" value="jar" />
    <property name="jarfilename" value="Number" />
    <property name="client" value="client" />
    <property name="main" value="main" />
    <property name="loader" value="loader" />

    <target name="clean">
        <delete dir="${build}" />
    </target>

    <path id="classpath">
        <fileset dir="${lib}" includes="*.jar" />
    </path> 

    <target name="compile">
        <delete dir="${lib}" />
        <mkdir dir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\swinglabs\swingx-core\1.6.2-2\swingx-core-1.6.2-2.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\springframework\spring-core\3.0.5.RELEASE\spring-core-3.0.5.RELEASE.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\springframework\spring-asm\3.0.5.RELEASE\spring-asm-3.0.5.RELEASE.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\springframework\spring-context\3.0.5.RELEASE\spring-context-3.0.5.RELEASE.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\springframework\spring-aop\3.0.5.RELEASE\spring-aop-3.0.5.RELEASE.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\springframework\spring-beans\3.0.5.RELEASE\spring-beans-3.0.5.RELEASE.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\org\springframework\spring-expression\3.0.5.RELEASE\spring-expression-3.0.5.RELEASE.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\log4j\apache-log4j-extras\1.0\apache-log4j-extras-1.0.jar" todir="${lib}" />
        <copy file="C:\Users\Tanmoy\.m2\repository\log4j\log4j\1.2.9\log4j-1.2.9.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\dj-nativeswing-0.9.8.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\dj-nativeswing-swt-0.9.8.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\dj-swingsuite-0.9.1.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\swt-linux32-3.6.2.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\swt-linux64-3.6.2.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\swt-osx32-3.6.2.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\swt-osx64-3.6.2.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\swt-win32-3.6.2.jar" todir="${lib}" />
        <copy file="F:\Number\Number\jars\swt-win64-3.6.2.jar" todir="${lib}" />

        <mkdir dir="${build}/${classes}/${main}" />
        <javac srcdir="${src}/${main}" destdir="${build}/${classes}/${main}" classpathref="classpath" />

        <mkdir dir="${build}/${classes}/${loader}" />
        <javac srcdir="${src}/${loader}" destdir="${build}/${classes}/${loader}" />
    </target>

    <target name="jar" depends="clean, compile">
        <mkdir dir="${build}/${jar}" />

        <jar destfile="${build}/${jar}/${client}.jar" basedir="${build}/${classes}/${main}">
            <fileset file="${src}/${main}/application-context.xml" />
            <fileset file="${src}/${main}/log4j.xml" />
        </jar>

        <jar destfile="${build}/${jar}/${jarfilename}.${jar}" basedir="${build}/${classes}/${loader}">
            <manifest>
                <attribute name="Main-Class" value="in.res.num.tpb.loader.ClientLoader" />
            </manifest>
            <fileset dir="${build}/${jar}" includes="${client}.jar" />
            <fileset dir="${lib}" includes="*.jar" />
        </jar>

        <delete file="${build}/${jar}/${client}.jar" />
    </target>

    <target name="run" depends="clean, compile, jar">
        <java jar="${build}/${jar}/${jarfilename}.${jar}" fork="true" />
    </target>
</project>
  • 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-24T21:56:43+00:00Added an answer on May 24, 2026 at 9:56 pm

    Use zip instead of jar. Why do you want to avoid a META-INF folder?

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

Sidebar

Related Questions

I'm using Ant 1.8.1. I have downloaded ant-contrib-1.0b3.jar and placed it in my $ANT_HOME/lib
I have the following ant build.xml : <path id=antclasspath> <fileset dir=lib> <include name=*.jar/> </fileset>
We are using ANT for our build process and don't have plans to change
I am using ant to build a jar of my project in eclipse. I
I'm using ant to generate the MANIFEST.MF for a .jar, and I need to
I have a project which I can build and deploy correctly using Ant I
I have a Maven build with three modules. Module A exports a jar. Module
Hallo, I cannot compile my project using an ant build script. The error message:
I need to compile a jar file using ant (1.7.0) to run under a
I'm using Ant to build some Java projects. In some, I've got a lib/

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.