This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes use Ant in Eclipse 3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "use Ant in Eclipse 3.1" Watch "use Ant in Eclipse 3.1" New topic

use Ant in Eclipse 3.1

meimei li

Joined: May 19, 2003
Posts: 24
I created a Tomcat project called "jsflogin" inside the eclipse IDE, added an ant build file "build.xml" under "jsflogin". It seems the IDE does recognize it'a an ant build file since an ant icon appears together with the file. However, after I select "Project"->"Build project" or "Build all", the project is not built.

I downloaded this JSF demo from and am trying to learn JSF.

What else should I do? Here is the build.xml file.

<?xml version="1.0" ?>
<project name="jsflogin" default="deploy" basedir=".">

<property name="name" value="jsflogin" />
<property name="src.dir" value="src" />
<property name="classes.dir" value="classes" />
<property name="" value="${name}.war"/>
<property name="deploy.dir" value="deploy" />
<property name="lib.dir" value="WEB-INF\lib" />
<property name="jsp.dir" value="pages" />
<property name="resources.dir" value="resources" />

<target name="init">
<mkdir dir="${deploy.dir}" />
<mkdir dir="${classes.dir}" />
<copy todir="${classes.dir}">
<fileset dir="${resources.dir}" />

<target name="compile" depends="init">
<javac srcdir="${src.dir}"
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>

<target name="deploy" depends="compile">
<war destfile="${deploy.dir}/${}" webxml="WEB-INF/web.xml">
<fileset dir="${jsp.dir}" includes="**\*" />
<lib dir="${lib.dir}" />
<classes dir="${classes.dir}" />
<webinf dir="WEB-INF" includes="**\*.xml" />




Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Project - Build would have eclipse build the project based on the way Project properties is configured. Looks like configure it with an ant builder, I haven't used that...check the help on ant builder.

From the eclipse help I searched on "run ant build" and one of the top hits is a common way to run ant buildfiles:

1. Select build.xml in one of the navigation views and choose Run As > Ant Build... from its context menu. (e.g. right click on build.xml)

2. A launch configuration dialog is opened on a launch configuration for this Ant buildfile.

3. This dialog allows the configuration of many aspects of the way an Ant buildfile is run, check the Targets tab which allows the selection of which Ant targets to run and their order if not planning to run the default.

4. Click Run.

5. The Ant buildfile is run, and the output is sent to the Console view.
GeeCON Prague 2014
subject: use Ant in Eclipse 3.1