ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Bauman" <>
Subject Re: properties files aren't getting included
Date Tue, 22 Jan 2002 17:06:28 GMT
Thanks for your help:

> ----- Original Message -----
> From: "Nick Bauman" <>
> To: <>
> Sent: Tuesday, January 22, 2002 8:29 AM
> Subject: properties files aren't getting included
>> Am I just being stupid? I have some properties files in my project
>> that ant seems to ignore when making a jar. I looked at the
>> documentation and I searched the archives and couldn't find anything
>> relevant on this subject.
> I assume you have the properties files next to the java source right?

Yes, it's in my src/ in a subpackage, right alongside my code.

> And then you jar up the compiled classes in the build directory, right?

> If these two guesses are correct, how are you getting the properties
> from the source dir to the build dir?

I'm not. That's the problem, then. I need some kind of parameter to 
the "dist" task to keep the properties with the compiled classes.   
> -steve

here's my ant build.xml:

<project name="foo" default="dist" basedir=".">

<!-- set global properties for this build -->
<property name="src" value="src" />
<property name="build" value="classes"/>
<property name="dist" value="lib"/>
<property name="javadoc" value="${dist}/doc"/>
<property name="rel" value="/usr/local/servlet/lib"/>
<property name="jarfile" value="foo.jar"/>
<property name="project" value="foo"/>
<property name="nightly" value="/usr/local/apache/dr/org/nightly"/>
<property name="build.compiler" value = "jikes"/>
<property name="build.compiler.emacs" value = "true"/>

<target name="default">
<mkdir dir="${build}"/>

<target name="compile" depends="default">
<!-- compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" debug="on" deprecation="on">
<pathelement path="${classpath}"/>
<fileset dir="/usr/local/jdk13/jre/lib">
<include name="**/*.jar"/>
<fileset dir="lib">
<include name="**/*.jar"/>
<fileset dir="lib/external-libs">
<include name="**/*.jar"/>
<pathelement location="classes"/>

<target name="dist" depends="compile">
<jar jarfile="${dist}/${jarfile}" basedir="${build}"/>

<target name="nightly" depends="clean,compile,javadoc">
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${nightly}/${project}-${DSTAMP}.jar" basedir="${build}"/>

<target name="release" depends="compile">
<jar jarfile="${rel}/${jarfile}" basedir="${build}"/>

<target name="clean">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}/org"/>
<delete dir="${javadoc}"/>
<delete dir="bak"/>
<delete file="${dist}/${jarfile}"/>

<target name="javadoc">
<mkdir dir="${javadoc}"/>
  <javadoc packagenames="org.*, doc.*"
           windowtitle="Foo API"
           doctitle="Foo Javadoc">

Nick Bauman 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message