ClassPath in Ant for Javac task


<project default="build.deploy.start" basedir=".">

  <property name="target.dir" value="C:\tom\webapp\"/>
  <property name="basesrc.dir" value="c:\SimpleChat\"/>    
  <property name="classes.target" value="${basesrc.dir}\WebContent\WEB-INF\classes"/>
  <property name="src.dir" value="${basesrc.dir}\src"/>
  <property name="classpath" value="${basesrc.dir}\WebContent\WEB-INF\classes"/>

  <!-- Classpath for the project --> 
  <path id="master-classpath">
   <fileset dir="${classpath}">
    <include name="*.jar"/>
   </fileset>
  </path>

  <!-- init method which will ensure that all directories exists before we start building/deploying-->
  <target name="init">
    <mkdir dir="${target.dir}\js"/>
    <mkdir dir="${target.dir}\images"/>
    <mkdir dir="${target.dir}\pages"/>
    <mkdir dir="${target.dir}\WEB-INF\lib"/>
    <mkdir dir="${target.dir}\WEB-INF\classes"/>
  </target>

  <!--To build an application so that files can be deloyed-->
  <target name="build" depends="init">
    <javac srcdir="${src.dir}" destdir="${classes.target}">
        <classpath refid="master-classpath"/>
    </javac>
  </target>
</project>




1 down vote accepted

Hard to tell. I can't see any obvious mistakes.

All the examples here:http://ant.apache.org/manual/Types/fileset.htmluse:

<include name="**/*.jar"/>

instead of just "*.jar" as you have, but what you have looks like it should be ok so long as the .jar files are directly inside \WebContent\WEB-INF\classes.



1 down vote accepted

Hard to tell. I can't see any obvious mistakes.

All the examples here:http://ant.apache.org/manual/Types/fileset.htmluse:

<include name="**/*.jar"/>

instead of just "*.jar" as you have, but what you have looks like it should be ok so long as the .jar files are directly inside \WebContent\WEB-INF\classes.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值