22

There are many questions on this topic but none of the answers are solving my problem. Starting this thread again to get fresh input.

I tried two different approaches for excluding B-dir and all its contents under A-dir/subdir. But none work. FYI, a-dir is under dir.src 1)

  <copy todir="${dir.classes}" excludes="A-dir/**/B-dir/**">
  <fileset dir="${dir.src}" >
    <exclude name="**/*.java"/>
  </fileset>
  </copy>

2)

  <copy todir="${dir.classes}">
  <fileset dir="${dir.src}" >
    <exclude name="**/*.java"/>
    <exclude name="A-dir/**/B-dir/**"/>
  </fileset>
  </copy>

I tried deleting all old jars and do a clean compile like someone suggested. But that doesn't help either.

user1164061
  • 4,222
  • 13
  • 48
  • 74

1 Answers1

33

I think it should probably be:

<copy todir="${dir.classes}">
<fileset dir="${dir.src}" >
  <exclude name="**/*.java"/>
  <exclude name="**/A-dir/**/B-dir/**"/>
</fileset>
</copy>

Note the **/A-dir/** instead of A-dir/**.

Tim Pote
  • 27,191
  • 6
  • 63
  • 65