import-bot (20211) [Avatar] Offline
[Originally posted by]

The properties never get picked up from

Property ${host} has not been set
Property ${port} has not been set
Property ${j2ee.home} has not been set
Property ${tomcat.home} has not been set
Property ${jboss.deploy.dir} has not been set
I get these even before the osfamily task executes

<?xml version="1.0" encoding="UTF-8"?>
<project name="greeting" default="compile" basedir="../">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="dist.dir" value="dist"/>
<property name="web.dir" value="web"/>

<property name="ant-contrib.jar" >

<taskdef resource="net/sf/antcontrib/">

<target name="osfamily">
<osfamily property=""/>
<echo message="${}"></echo>
<property file="${}.properties"></property>

<!--<property file=""/>-->
<property name="url.manager" value="http://${host}:${port}/manager"/>
<path id="project.classpath">
<pathelement location="${j2ee.home}/lib/j2ee.jar" />
<pathelement location="${tomcat.home}/server/lib/catalina-ant.jar"/>

<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>

<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>

<target name="compile" depends="prepare">
<!--Use <pathconvert> to convert path into a property-->
<pathconvert targetos="windows" property="windowsPath">
<echo>Windows path = ${windowsPath}</echo>

<javac destdir="${build.dir}" debug="true">
<src path="${src.dir}"/>
<classpath refid="project.classpath"/>

<target name="war" depends="compile">
<war warfile="${dist.dir}/${}.war">
<fileset dir="${web.dir}" includes="*.jsp"/>
<fileset dir="${web.dir}" includes="**/*.gif"/>
<classes dir="${build.dir}" includes="**/*.class"/>
<metainf dir="${web.dir}" includes="*.xml"/>
import-bot (20211) [Avatar] Offline
Re: Problem using osfamily task
[Originally posted by erikhatcher]

The order of events in an Ant build file is to run *all* tasks not in a target
before executing the
desired target. This is why its best to put all non-target tasks at the top
of the build file for clarity.
Rearrange your build file so that all uses of the properties defined in are after
you load that file. Unfortunately with Ant 1.5.x this will require moving
<property> statements
into a target because of the restrictions of what cannot be outside of a target.