ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Java task in Linux
Date Fri, 07 Sep 2001 15:01:03 GMT
The "*.jsp" is your problem. On Win* systems, every command deals with
wildcard expansion itself, which is why this works for you on your Win2K.
On Unix, wildcard expansion is done by the shell before the command is
run. Ant doesn't go through the shell, so on your Linux system your 'java'
command is being handed a literal "*.jsp" instead of all the .jsp
filenames. I think you'll probably want to look at the <apply> task, which
uses a <fileset>, and also has the added advantage of only handing off
source-files that are newer than their targets.


--- "Salvador I. Ducros" <> wrote:
> Part of a build target in my build.xml file tries to compile
> a group of JSP sources into Java sources using the JSP compiler
> in Tomcat. The relevant task looks like this:
>     <java fork="yes" dir="projects/template/gui/jsp"
> classname="org.apache.jasper.JspC">
>         <classpath refid="jspcp" />
>         <arg line="-uriroot . *.jsp" />
>         <jvmarg line="-Dtomcat.home=${basedir}/tomcat" />
>     </java>
> The 'jspcp' refid in the 'classpath' is defined at the top of my
> build.xml file with a <path> ... </path> statement. This works perfectly
> on Windows 2000 but breaks on Linux. The output on linux returned is:
>     Buildfile: build.xml
>     init:
>     build:
>          [java] 2001-09-06 09:07:54 - The file argument '*.jsp' does not
> exist
> I can run the equivalent Java command line from the shell and it will
> compile
> the JSPs successfully.
>     e.g. java -Dtomcat.home=$TOMCAT_HOME org.apache.jasper.JspC -uriroot
> *.jsp
>          N.B. With TOMCAT_HOME and CLASSPATH set appropriately of course
> and
>               executed from the directory containing the JSP sources.
> Anyone ever have similar problems? I'm left with two suspicions. One is
> that the JVM is not being forked from the directory specified by the
> 'dir'
> attribute in the 'java' task (projects/template/gui/jsp in this case).
> My second suspicion was that the wildcard '*.jsp' was not being
> expanded.
> Any ideas? Like I said, this works on Windows 2000.
> Salvador Ducros


Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger

View raw message