Alex Rivera | Logout

Ant buildfile does not contain a javac task

Asked 2012-05-28T08:24:38.450
15

I have build.xml file and I want to create Java project from Existing Ant Buildfile. But I have an error: Specified buildfile does not contain a javac task My file has simple structure:

<project>
     <target ...>
     </target>
     ...
</project>
Edit
Report

1 Answer

0

You need something like this,

    <target name="compile">
  <javac destdir="build/classes" srcdir="src" includeantruntime="false">
    <classpath refid="compile.classpath"/>
  </javac>
  </target>

    <target name="war" depends="compile">   
  <war destfile="build/${name}.war" webxml="WebContent/WEB-INF/web.xml">
   <fileset dir="WebContent" casesensitive="no">
   </fileset>
   <lib dir="WebContent/WEB-INF/lib"/>
   <classes dir="build/classes">
   </classes>   
  </war>
</target>
answered 2013-07-31T10:54:20.987

Your Answer