tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Subir Sengupta <su...@walmart.com>
Subject RE: build.xml for Ant/JspC
Date Thu, 03 Oct 2002 17:51:42 GMT
Here's a snippet of my build.xml (but I don't have a refid).  It seems to
work though.

     <!-- JSPC:  pre-compile JSPs -->
     <target name="jspc">
          <java classname="org.apache.jasper.JspC">
               <classpath>
                    <pathelement location="${java.home}/lib/tools.jar"/>
                    <fileset dir="/home/subir/www/tomcat/server/lib">
                         <include name="**/*.jar"/>
                    </fileset>
                    <fileset dir="/home/subir/www/tomcat/common/lib">
                         <include name="**/*.jar"/>
                    </fileset>
                    <fileset dir="/home/subir/www/tomcat/lib">
                         <include name="**/*.jar"/>
                    </fileset>
                    <pathelement location="${build.home}/WEB-INF/" />
               </classpath>
               <arg value="-d" />
               <arg file="${deploy.home}" />
               <arg value="-v9" />
               <arg value="-webapp" />
               <arg value="${src}" />
          </java>
     </target>

Also I found an earlier posting that might help:
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14936.html

Thanks for posting your compiler snippet.
Subir

-----Original Message-----
From: Kevin HaleBoyes [mailto:kzboyes@yahoo.com]
Sent: Thursday, October 03, 2002 5:56 AM
To: sachin@nuix.com.au; tomcat-user@jakarta.apache.org
Subject: Re: build.xml for Ant/JspC


> There is a snippet of the build.xml that we use for jsp
compilation.

I'm lurking on this thread but wanted to ask:
What is your <classpath refid="all-classpath" /> set to?
I've attempted JspC but I get class-not-found errors and when I
resolve them I get problems with the endorsed/sealed XML classes.

In the end I resorted to calling jspc.sh as shipped with Tomcat
as it seems to manage the classpath properly:

    <exec executable="/bin/sh">
        <arg line="${catalina.home}/bin/jasper.sh"/>
        <arg line="jspc"/>
        <arg line="-webapp ${build.home}"/>
        <arg line="-webinc ${build.jspc.home}/webinc.xml"/>
        <arg line="-uriroot ${build.home}"/>
        <arg line="-p com.mydomain"/>
        <arg line="-d ${build.jspc.home}"/>
        <arg line="-v"/>
    </exec>

In answer to another posters question (sorry, I don't remember
who it was), once the above call to jspc.sh finishes I then call
the java compiler as follows:

    <javac srcdir="${build.jspc.home}"
          destdir="${build.home}/WEB-INF/classes"
            debug="${compile.debug}"
      deprecation="${compile.deprecation}"
         optimize="${compile.optimize}">
        <classpath refid="compile.classpath"/>
        <include name="**/*.java"/>
    </javac>

Thanks,
Kevin.


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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

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


Mime
View raw message