user3114967
user3114967

Reputation: 629

How to exclude particular java folders and java files using ANT Build

I'm using ANT build.xml for compile the java code and move the file into tomcat. Its working fine but now I've created multiple folders based on project requirement LIKE,

     com/abc/bean/abcbean.java
     com/abc/bean/model/abcmodel.java
     com/abc/bean/model/util/abcutil.java

So i want to exclude the files com/abc/bean/model/abcmodel.java and include other folders and files. How can i do this?

Upvotes: 0

Views: 450

Answers (1)

P.A. Cros
P.A. Cros

Reputation: 511

If you want to exclude files at compilation time, you may use options provided by javac ant task (http://ant.apache.org/manual/Tasks/javac.html). For instance:

<javac srcdir="${src}"
       destdir="${build}"
       includes="com/abc/**"
       excludes="com/abc/bean/model/*.java"/>

you may also use nested elements to do more complex filtering job (see ant documentation link above).

Upvotes: 1

Related Questions