ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christofer Jennings" <>
Subject trouble with basedir (I think)
Date Mon, 12 Jun 2006 23:56:43 GMT
I'm having trouble with basedir (I think).

It all started with me trying to run a build.xml script from cruisecontrol
(CC). CC uses wrapper scripts to run project builds. I've run the wrapper
without CC and got the same results, so it's not CC. The wrapper build file
looks like this...

<project name="foo build wrapper" default="build" basedir="projects/foo">
    <target name="build">
       <echo message="path right now is ${java.library.path}" />
        <!-- Get the latest from CVS -->
        <cvs command="up -d -P"/>
        <!-- Call the target that does everything -->
        <ant antfile="build.xml" target="clean"/>
        <ant antfile="build.xml" target="common.compile"/>

This works fine for my other projects, but for foo I get weird results. So I
think maybe it has to do more with foo's build file than the wrapper.Foo's
build has lots of stuff in it, so I'll try to limit it here...

<?xml version="1.0"?>
<project name="Foo Builder" default="usage" basedir=".">

  <target name="init">
    <property file=""/>


    <property name="root.dir" value="."/>
    <property name="lib.dir" value="${root.dir}/lib"/>

    <property name="src.dir" value="${root.dir}/src"/>
    <property name="web.dir" value="${src.dir}/web"/>
    <property name="java.dir" value="${src.dir}/java"/>

    <property name="build.dir" value="${root.dir}/build"/>

    <property name="common.dir" value="${build.dir}/common"/>
    <property name="common.classes" value="${common.dir}/classes"/>

    <property name="wl.home" value="${beahome}/weblogic91"/>
    <property name="wl.lib" value="${wl.home}/server/lib"/>

    <taskdef name="wlappc" classname="weblogic.ant.taskdefs.j2ee.Appc"
    <taskdef name="autotype" classname="

    <path id="common.classpath">
      <fileset dir="${lib.dir}">
        <include name="log4j.jar"/>
        <include name="dfc2-client.jar"/>
        <include name="jdc21-client.jar"/>
      <pathelement path="${common.classes}"/>

  <target name="clean" depends="init">
    <delete dir="${build.dir}" includeEmptyDirs="true"/>

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

  <target name="common.compile" depends="prepare">
    <mkdir dir="${common.classes}"/>
    <javac srcdir="${java.dir}" destdir="${common.classes}">
      <classpath refid="common.classpath"/>
      <include name="foo/dto/*.java"/>


So, on to the problem. When I run foo's build directly it works fine, but
when I use the wrapper build I get ...

C:\cc\projects\foo\src\java\foo\util\ package javax.ejb does not
import javax.ejb.CreateException;

It makes no sense to me. Why would something in foo/util be compiled when
javac clearly is et to <include name="foo/dto/*.java"/>?

I tried not using basedir in the wrapper build file. But then the taskdefs
don't load... which does make sense to me.

Any insights would be much appreciated.

Thanks in advance,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message