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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:54:38+00:00 2026-06-14T23:54:38+00:00

I need to create a jar with all source files attached. So for each

  • 0

I need to create a jar with all source files attached. So for each *.class file there must be a corresponding *.java file in the same directory. I think this is something trivial, however I have not found a solution working for me so far :S.

I have also tried to use the include tag with */, but then in the created jar file there are still only *.class files and no *.java files. What am I doing wrong?

<target name="build-jar" description="Creates the jar file>
<jar jarfile="${webinf.dir}/lib/components.jar"
 basedir="${jarSource.dir}"
 includes="**/*">    
</jar>
</target>
  • 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-14T23:54:39+00:00Added an answer on June 14, 2026 at 11:54 pm

    try

    <jar destfile="${target.dir}/my-app.jar">
        <fileset dir="${target.dir}/classes" />
        <fileset dir="${src.dir}" includes="**/*.java"/>
    </jar>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to create a jar file containing class files generated from a given xsd
I need to create a hadoop job jar file that uses mahout and a
I need an example pom file to create a jar file for my spring
I've written a program in Java (executable JAR) and need to create an installer
I need to create some directories and files and all of them should have
I tried to create a jar file from a java project, which uses some
I need create a document word with Java. And I ask, how can I
i need create a variable with parent subclass. Example: Parent Class <?php class parentClass
I have a scenario where-in I need to create an uber jar of a
I have extract the JAR file with winrar, and i able to saw all

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.