Jeb,
I just tested this, and it worked fine for me (although I did change a few
things in the target, to make it match my dirs/classpath):
<target name="compile">
<javac srcdir="src" destdir="${out.dir}"
classpath="${compile.classpath}"
debug="on" optimize="off" deprecation="off"/>
</target>
I created "src/foo" under my basedir, then put your Foo.java in src/foo,
ran 'ant', and it resulted in:
Buildfile: test.xml
Target: compile
[javac] Compiling 1 source file to D:\dianeh\src\main\classes
[javac] D:\dianeh\src\main\src\foo\Foo.java(1): Type expected
[javac] 1 error(s), 0 warning(s)
BUILD FAILED
test.xml:200: Compile failed, messages should have been provided.
Total time: 1 second
Are you sure that the "src" dir that's relative to your "basedir" is the
one that contains your java source? If there aren't any .java files in the
srcdir pointed to, <javac> won't complain about not finding any. You might
want to try explicitly <include>'ing Foo.java and see what happens that
way.
Diane
--- "Boniakowski,Jeb" <[EMAIL PROTECTED]> wrote:
> Hi. Sorry for this admittedly annoying type of question, but I can't
> figure
> out the answer, after reading everything else I could find.
>
> I'm using basically the included build.xml. Here's the compile target:
>
> <target name="compile" depends="prepare">
> <javac srcdir="src" destdir="${deploy.home}/WEB-INF/classes"
> classpath="${deploy.home}/WEB-INF/classes"
> debug="on" optimize="off" deprecation="off"/>
> </target>
>
> Haven't changed it all. All of my directories are set up as suggested
> by
> the docs.
>
> The comment in build.xml says that the "javac" task should recurse down
> the
> dir tree compiling classes that don't exist or are newer than their
> .class
> files. Well, mine doesn't even go down one level. If I put a file in
> src
> that looks like this:
>
> Foo.java:
> public class Foo{ break compiler }
>
> Ant marches on ahead without complaint. There is no Foo.class in my
> {deploy.home}/WEB-INF/classes directory. It copies non-.java files from
> my
> src/ dir fine. If I do "build clean", my webapps/nnt (name of my app)
> is
> deleted. If I do build all, it is deleted and then all of the classes
> are
> copied back to the same place and work fine and all, but only if I go
> through the src/ try and manually compile them first.
>
> Does anyone have any idea what I am missing here?
>
> jeb.
>
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/