properties - Ant Fileset Expansion doesn't work -


I am getting very deceptive feedback from my ant build-file and I'm wondering if I'm not just smart or It can actually be a bug.

I have found the following asset globally in my project:

   

Then I will try to add some files out of this directory to a jar file via fileset (multiple resources):

  & lt ; Fileset Dir = "$ {baseir}" includes = "lib / * filename *" />  

There should be 3 different libraries (and present) that match in this way However, if I try to use the following, then it does not work No more files are included:

  & lt; Fileset dir = "$ {baseir}" includes = "$ {lib.dir} / * file name *" />  

Note that only the difference in the use of global property is the difference. Now the common question: Why does the first edition work as ad, but not the second?

Please check the actual value of "lib.dir" and possibly use "fileset" expression After the work you have done, just to ensure that it has not been accidentally changed after you set it globally & lt; Echo / & gt; The job can help.


Maybe I got the solution: Description of the location attribute:

sets the property for the full filename of the given file If the value of this attribute is a complete path, then it has been left unchanged (in conjunction with / converted to current and platformforms). Otherwise it is taken as a relative path on the basis of the project and is expanded.

Use the value attribute instead of just location . Here is an exam script to show the difference:

  & lt; Project name = "test" & gt; & Lt; Property Name = "test1" location = "lib" & gt; & Lt; / Property & gt; & Lt; Property Name = "test2" value = "lib" & gt; & Lt; / Property & gt; & Lt; Target name = "target" description = "description" & gt; & Lt; Echo & gt; $ {Test1} & lt; / Echo & gt; & Lt; Echo & gt; $ {Test2} & lt; / Echo & gt; & Lt; / Target & gt; & Lt; / Project & gt;  

The output on my system is as follows:

  Buildfile: D: \ Develop \ workspace-jabber \ scrapbook \ build.xml Target: [echo] D: \ development \ workspace-jabber \ scrapbook \ lib [echo] ob build successfully total time: 307 milliseconds  

Comments