I'm trying to discard @WebService
annotated classes in my Ant build using not
and contains
keywords. However, it isn't working and still includes classes annotated with @WebService
. Here is the task used to copy sources to the working build directory:
<copy todir="${compile.dir}">
<fileset dir="${src.dir}">
<include name="**/*" />
<exclude name="**/*.class" />
<exclude name="log4j.properties" />
<exclude name="log4j.properties.*" />
<exclude name="log4j.xml" />
<exclude name="log4j.xml.*" />
<exclude name="*.jocl" />
<not>
<contains text="@WebService(" casesensitive="true" />
</not>
</fileset>
</copy>
However, it seems like the not
section is ignored, and those classes are still copied. Why isn't this working? Is the syntax wrong? Also, how do I add a condition, so that the restriction concerns only .java
files?
I'm using Apache Ant(TM) version 1.9.6 compiled on July 8 2015
.