swanwish / blog

My blog website
0 stars 0 forks source link

Getting Ant <javac> to recognise a classpath #18

Open swanwish opened 7 years ago

swanwish commented 7 years ago

Getting Ant to recognise a classpath

Here's an example from a project I am currently working on. I suspect you can modify it to work for your situation.

<path id="master-classpath">
  <fileset dir="${web.dir}/WEB-INF/lib">
    <include name="*.jar"/>
  </fileset>

  <fileset dir="${appserver.lib}">
    <include name="servlet*.jar"/>
  </fileset>

  <pathelement path="${build.dir}"/>
</path>

...

<javac destdir="${build.dir}">
  <src path="${src.dir}"/>
  <classpath refid="master-classpath"/>
</javac>