You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Kenneth Litwak <kl...@apu.edu> on 2004/05/12 01:19:24 UTC
Basic syntax problem
In spite of reading a book on Ant, I'm still having significant
problems in understanding the pieces, particularly frustrating given
what else I've done as a programmer (not meant as a boast, but if you
can code a CMP EJB,a scripting language shouldn't be hard). My team ha
a big Ant build script. I added a task that is supposed to run from a
basedir, apu-reg, and use the test.class file in
Basedir/build/test/classes/edu/apu/directory/test.class
And when running be able to refer to classes in
basedir/build/classes/edu/apu/directory/*.class
as well as
basedir/build/classes/edu/apu/registration/*.class
I already have a compile task for the Test.java, written by someone
else.
I copied it and modified it to write this:
<echo message="Running Test ${class} ${args}"/>
<java fork="true" dir="${build.dir}"/test/classes
classname="${class}">
<arg line="${args}"/>
<classpath>
<pathelement
path="${build.dir}/test/classes"/>
<pathelement path="${build.dir}/classes"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</java>
</target>
When I run ant test-run, I get an error for this task:
Buildfile: build.xml
BUILD FAILED
C:\cvsfolder\javalib\apu-reg\build.xml:207: Element type "java" must be
followed
by either attribute specifications, ">" or "/>".
Total time: 0 seconds
So what am I missing? I could sure use something to read that gives a
detailed explanation of pathelements and filesets. The book I have is
not nearly detailed enough for my purposes. I have no idea if I've got
this specified correctly. Thanks.
Ken
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Basic syntax problem
Posted by "Jack J. Woehr" <ja...@purematrix.com>.
Kenneth Litwak wrote:
>
> <java fork="true" dir="${build.dir}"/test/classes
/test/classes cannnot dangle outside the quotation marks. Correct is:
<java fork="true" dir="${build.dir}/test/classes"
... etc. ... the quotes are not concatenation operators, they're marks
of XML syntax.
--
Jack J. Woehr # We have gone from the horse and buggy
Senior Consultant # to the moon rocket in one lifetime, but
Purematrix, Inc. # there has not been a corresponding moral
www.purematrix.com # growth in mankind. - Dwight D. Eisenhower
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Basic syntax problem
Posted by Peter Davison <pe...@tfnet.ca>.
Hi Kenneth.
If your code snippet is straight out of your build script (and it's not just a
typo in your email) you have a double quote '"' in the wrong place. Replace:
<java fork="true" dir="${build.dir}"/test/classes
with
<java fork="true" dir="${build.dir}/test/classes"
Not sure if that's the only problem, :-) but it would definitely be the cause
of the mentioned error.
Hope that helps.
Pete.
On Tue, 11 May 2004 16:19:24 -0700
"Kenneth Litwak" <kl...@apu.edu> wrote:
> In spite of reading a book on Ant, I'm still having significant
> problems in understanding the pieces, particularly frustrating given
> what else I've done as a programmer (not meant as a boast, but if you
> can code a CMP EJB,a scripting language shouldn't be hard). My team ha
> a big Ant build script. I added a task that is supposed to run from a
> basedir, apu-reg, and use the test.class file in
> Basedir/build/test/classes/edu/apu/directory/test.class
> And when running be able to refer to classes in
> basedir/build/classes/edu/apu/directory/*.class
> as well as
> basedir/build/classes/edu/apu/registration/*.class
>
> I already have a compile task for the Test.java, written by someone
> else.
> I copied it and modified it to write this:
> <echo message="Running Test ${class} ${args}"/>
> <java fork="true" dir="${build.dir}"/test/classes
> classname="${class}">
> <arg line="${args}"/>
> <classpath>
> <pathelement
> path="${build.dir}/test/classes"/>
> <pathelement path="${build.dir}/classes"/>
> <fileset dir="${lib.dir}">
> <include name="*.jar"/>
> </fileset>
> </classpath>
> </java>
> </target>
>
> When I run ant test-run, I get an error for this task:
>
> Buildfile: build.xml
>
> BUILD FAILED
> C:\cvsfolder\javalib\apu-reg\build.xml:207: Element type "java" must be
> followed
> by either attribute specifications, ">" or "/>".
>
> Total time: 0 seconds
>
>
> So what am I missing? I could sure use something to read that gives a
> detailed explanation of pathelements and filesets. The book I have is
> not nearly detailed enough for my purposes. I have no idea if I've got
> this specified correctly. Thanks.
>
> Ken
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Peter Davison
peterdavison@tfnet.ca
h: 416 699 2964
c: 416 566 8461
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org