ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <kad...@gfs.com>
Subject Spaces in the path, XSLT, and Java
Date Fri, 10 Jan 2003 13:51:05 GMT
I have a buildfile that's dynamically generates via XSLT.  Within that
buildfile, I make a java call; one of the args passed into that java
call (via <jvmarg>) contains the property ${user.home}.  On Windows
2000, that resolves to c:\Documents and Settings\<username>, which
causes the java call to fail.

>From the xsl template:

        <java classname="org.apache.tools.ant.Main" fork="yes"
failonerror="no" dir="${{env.DEV_DIR}}/{@basedir}">
            <xsl:choose>
                <xsl:when test="/workspace/@output = 'stdout'">
                    <arg line="-listener
org.apache.tools.ant.TextLogger"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:attribute name="output"><xsl:value-of
select="$logdir"/><xsl:text>/buildlog-</xsl:text><xsl:value-of
select="@name"/><xsl:text>.txt</xsl:text></xsl:attribute>
                </xsl:otherwise>
            </xsl:choose>
            <jvmarg line="-Dlogfile="{$logdir}/buildlog-{@name}.txt"/>
            <jvmarg line="-Dsnap.home=${{env.SNAP_HOME}}"/>
            <jvmarg line="-Ddev.dir=${{env.DEV_DIR}}"/>
            <jvmarg line="-Dtoken.dir=${{token.dir}}"/>
            <arg line="-listener org.apache.tools.ant.MailListener2"/>
            <arg line="-listener org.apache.tools.ant.XmlLogger
-DXmlLogger.file={$logdir}/buildlog-{@name}.xml"/>
            <arg line="-logger org.apache.tools.ant.NoBannerLogger"/>
            <arg line="-buildfile {$snap-file} -emacs snap"/>
            <classpath>
                <pathelement path="${{java.class.path}}"/>
            </classpath>
        </java>

The line of particular concern is:

            <jvmarg line="-Dlogfile="{$logdir}/buildlog-{@name}.txt"/>
 
$logdir is an XSL variable that (by default) contains the ant variable
${user.home}.  The error message I receive is:

     [java] java.lang.NoClassDefFoundError: and
     [java] Exception in thread "main"
     [java] Java Result: 1

Any solution needs to work in XSL, Ant, and be a valid java call.



Kyle Adams
Java Developer
Gordon Food Service

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


Mime
View raw message