You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Thomas George <tg...@iidc.org> on 2005/06/17 21:48:39 UTC

Problems with build file

Hello,

I'm getting strange javac error messages from an Ant build and since I'm a
new Ant user, I'm really not sure where to start troubleshooting.

Here is the error:

[javac] src\[PathToFile]\filenameDTO.java added as
src/[PathToFile]\filenameDTO.class doesn't exist.

I can't tell if the file is not being found, or if its not being writtne
into the src directory

Here is my build.xml:

<project name="MyProject" default="dist" basedir=".">
    <description>
        simple example build file
    </description>
  <!-- set global properties for this build -->
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>
  <property name="Model" location="Model"/>
  <property name="viewController" location="viewController"/>

<path id="buildClasspath">
      <fileset dir="./lib/" includes="*.jar" />
</path>

<!-- Targets -->

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>


  <target name="compile" depends="init" description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${Model}" destdir="${build}" source="1.4" target="1.4"/>
    <javac srcdir="${viewController}" destdir="${build}" source="1.4"
target="1.4"/>
  </target>
  <target name="dist" depends="compile" description="generate the
distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file
-->
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
  </target>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>

All of the necessary .jar libraries are in ./lib

Any suggestion would be greatly appreciated..!

Much thanks,

Thomas



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problems with build file

Posted by Bijo Alex Thomas <bi...@dsrc.co.in>.
This happens when java files within ${src} is not placed as per package
hierarchy. Ant expects the file ${src}\foo\bar\filenameDTO.java to be in
package foo.bar

So if the ${src}\foo\bar\filenameDTO.java is in pacakge foo1.bar1,
Ant will always complain that

[javac] ${src}\foo\bar\filenameDTO.java added as
${build}/foo/bar/filenameDTO.class  doesn't exist.

After compiling Ant will create class file as
${build}/foo1/bar1/filenameDTO.class

For more info,
http://ant.apache.org/faq.html#always-recompiles

Regards,
Bijo

_________________________________
Bijo Alex Thomas
DSRC, 6, Smith Road, Chennai - 2
Mail: bijoalex@dsrc.co.in
Website: http://dsrc.com



----- Original Message -----
From: "Thomas George" <tg...@iidc.org>
To: <us...@ant.apache.org>
Sent: Saturday, June 18, 2005 01:18 AM
Subject: Problems with build file


> Hello,
>
> I'm getting strange javac error messages from an Ant build and since I'm a
> new Ant user, I'm really not sure where to start troubleshooting.
>
> Here is the error:
>
> [javac] src\[PathToFile]\filenameDTO.java added as
> src/[PathToFile]\filenameDTO.class doesn't exist.
>
> I can't tell if the file is not being found, or if its not being writtne
> into the src directory
>
> Any suggestion would be greatly appreciated..!
>
> Much thanks,
>
> Thomas
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>







---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org