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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:13:31+00:00 2026-06-12T11:13:31+00:00

Got a following build.xml string: <jar destfile=${lib.dir}/rpt.jar basedir=${classes.src} excludes=**/*.java /> I am new to

  • 0

Got a following build.xml string:

<jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />

I am new to Ant and i don’t understand how excludes string works. What files are affected? All java source files?

Thanks.

  • 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-12T11:13:32+00:00Added an answer on June 12, 2026 at 11:13 am

    First about the statement

    <jar destfile="${lib.dir}/rpt.jar" basedir="${classes.src}" excludes="**/*.java" />
    

    this target is used to package your files inside a jar archive

    destfile : specifies the name and location of the destination file, the archive that would be created

    basedir : specifies the base directory of the files that needed to be packaged. note that all files and subfolders would be included

    excludes : this is used to exclude files from basedir that you dont need inside your package (jar)

    Now to your question

    what the above statement would do is that it will package all the files inside classes.src to $(lib.dir)/rpt.jar but will exclude any .java files found at or inside any sub folder of basedir.

    EDIT :
    This exclude=”*/.java” is generally done to exclude source code form the jar which would be used, distributed,exported etc

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

Sidebar

Related Questions

my build.XML is given below. <property name=src.dir value=src/> <property name=lib.dir value=lib/> <property name=build.dir value=build/>
Use 'ant clean test' with the newest android sdk got error: build.xml:622: The following
I've got the following build environment : Ubuntu Java 1.6.0_24 Apache ant 1.8.2 Jenkins
My project runs perfectly fine with following commands: C:\project\<project_name>\ant -lib ant\lib -buildfile applications/<sub-project-path>/ant/build.xml deploy
I got the following testng.xml and build.xml: <suite name=My test suite preserve-order=true> <parameter name=a
i downlaoded three20 p31. when i tried to build i got errors in following
I've got a following problem: I have configured a ant plugin within my pom.xml
I want to execute an ant build through java code. I use the following
I've got the following xml file: <?xml version=1.0 encoding=utf-8?> <Project ToolsVersion=4.0 DefaultTargets=DeployPrototype xmlns=http://schemas.microsoft.com/developer/msbuild/2003> <PropertyGroup>
I have the following build script, which I run with MSBuild: <?xml version=1.0 encoding=utf-8?>

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.