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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:42:02+00:00 2026-05-17T16:42:02+00:00

In a project we have several source paths, so we defined a reference path

  • 0

In a project we have several source paths, so we defined a reference path for them:

<path id="de.his.path.srcpath">
    <pathelement path="${de.his.dir.src.qis.java}"/>
    <pathelement path="${de.his.dir.src.h1.java}"/>
    ...
</path>

Using the reference works fine in the <javac> tag:

<src refid="de.his.path.srcpath" />

In the next step, we have to copy non-java files to the classpath folder:

<copy todir="${de.his.dir.bin.classes}" overwrite="true">
    <fileset refid="de.his.path.srcpath">
       <exclude name="**/*.java" />
    </fileset>
</copy>

Unfortunately, this does not work because “refid” and nested elements may not be mixed.

Is there a way I can get a set of all non-java files in my source path without copying the list of source paths into individual filesets?

  • 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-17T16:42:03+00:00Added an answer on May 17, 2026 at 4:42 pm

    Here’s an option. First, use the pathconvert task to make a pattern suitable for generating a fileset:

    <pathconvert pathsep="/**/*,"
                 refid="de.his.path.srcpath"
                 property="my_fileset_pattern">
        <filtermapper>
            <replacestring from="${basedir}/" to="" />
        </filtermapper>
    </pathconvert>
    

    Next make the fileset from all the files in the paths, except the java sources. Note the trailing wildcard /**/* needed as pathconvert only does the wildcards within the list, not the one needed at the end:

    <fileset dir="." id="my_fileset" includes="${my_fileset_pattern}/**/*" >
         <exclude name="**/*.java" />
    </fileset>
    

    Then your copy task would be:

    <copy todir="${de.his.dir.bin.classes}" overwrite="true" >
        <fileset refid="my_fileset" />
    </copy>
    

    For portability, instead of hard-coding the unix wildcard /**/* you might consider using something like:

    <property name="wildcard" value="${file.separator}**${file.separator}*" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use CMake to build my C++ project and I have a
Suppose we have a Project with three applications — A, B and C. Our
I have a maven project which uses the shade plugin to create a jar
I have a C# application that uses several web services which were added to
I have a hierarchical maven project, from which I am trying to build a
My shop has a precedent of checking in 3rd party tools to source control
I have a Crystal Report used in an ASP.NET web application that I've just
I think it's unreasonable for a library to require preprocessing of my source code
I am trying to build a library of silverlight controls where the client can
I'm doing the Agile Yii book. Anyway, I'm trying to execute this command: INSERT

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.