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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:30:07+00:00 2026-05-16T00:30:07+00:00

I get a very confusing reaction from my ant build-file and I’m wondering whether

  • 0

I get a very confusing reaction from my ant build-file and I’m wondering whether I’m just not clever enough or this might actually be a bug.

I’ve got the following property set globally in my project:

<property name="lib.dir" location="lib"/>

Then I’ll try to add some files out of this directory into a jar file via fileset (more than one resource):

<fileset dir="${basedir}" includes="lib/*filename*"/>

There should be (and exist) 3 different libraries, which are matched that way. However, if I try to use the following, it doesn’t work and no files are included:

<fileset dir="${basedir}" includes="${lib.dir}/*filename*"/>

Note that the only differences lies in the usage of the global property. Now the simple question: why does the first version work as advertised, but the second doesn’t?

  • 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-16T00:30:09+00:00Added an answer on May 16, 2026 at 12:30 am

    Please check the actual value of “lib.dir” just before and maybe after the task that uses the “fileset” expression. Just to make sure, that it hasn’t been changed accidently after you’ve set it globally. The <echo/> task can help.


    Maybe I got the solution. The description of the locationattribute is:

    Sets the property to the absolute filename of the given file. If the value of this attribute is an absolute path, it is left unchanged (with / and \ characters converted to the current platforms conventions). Otherwise it is taken as a path relative to the project’s basedir and expanded.

    Simply use the value attribute instead of location. Here’s a test script to show the difference:

    <project name="test">
    
        <property name="test1" location="lib"></property>
        <property name="test2" value="lib"></property>
    
        <target name="target" description="description">
           <echo>${test1}</echo>
           <echo>${test2}</echo>
        </target>
    
    </project>
    

    The output on my system is as follows:

    Buildfile: D:\Develop\workspace-jabber\scrapbook\build.xml
    target:
         [echo] D:\Develop\workspace-jabber\scrapbook\lib
         [echo] lib
    BUILD SUCCESSFUL
    Total time: 307 milliseconds
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get a very confusing crash where I am currently running out of my
I'm having a very confusing issue and I was wondering if someone could shed
I get very much confused when it comes to pointers. I want to know
In Ndepend we can get very good dependency diagrams showing which methods are called.
i'm working with OpenSSL lib and get very strange effect with AES encrypt/decrypt: if
Tried to search for this online and didn't get very far, so I'm asking
I am using gmp's mpf_t to try and get very high precision. My range
So, I thought I'd try my luck on ASP.NET. I didn't get very far
I'm trying to get a very simple Spring @mvc app to work and I'm
I am new to WSO2 ESB and am attempting to get a very simple

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.