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 have a project with several sources directories : src/A /B /C In each,
I have a solution with several projects. One of them is a setup project.
I have several small open-source projects that I wrote. All my attempts to find
I have several somewhat separate programs, that conceptually can fit into a single project.
Where I work I have several projects in separate repositories. Each project shares a
In a legacy project that I'm on, we have several processing that are preformed
I am using a Cairngorm MVC architecture for my current project. I have several
I believe several of us have already worked on a project where not only
I have a .NET 3.5 WinForms project that uses several 3rd party controls and
I have a solution with several projects, where the startup project has a post-build

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.