• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Mike London

use Ant in Eclipse 3.1

Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 www.javaranch.com/newsletter/200404/JSF_Part1.html 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="deploy.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}/${deploy.name}" webxml="WEB-INF/web.xml">
<fileset dir="${jsp.dir}" includes="**\*" />
<lib dir="${lib.dir}" />
<classes dir="${classes.dir}" />
<webinf dir="WEB-INF" includes="**\*.xml" />



Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
    Bookmark Topic Watch Topic
  • New Topic