You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by John Cavacas <oo...@rogers.com> on 2004/03/06 21:23:47 UTC

Class Cast exception trying to use org.apache.jasper.JspC

Hi,

I'm new to Maven, and I've been taking some time to learn its features,
and especially how to integrate it into the various
development/deployment/configuration scenarios that I deal with on a
regular basis. Todays task: pre-compiling JSPs...

I have the following in my maven.xml:

 <goal name="compile-jsp">
    <ant:path id="jspc.classpath">
      <ant:path refid="maven.dependency.classpath"/>
      <ant:pathelement path="${maven.build.dest}"/>
    </ant:path>

<ant:taskdef name="jasper2"   classname="org.apache.jasper.JspC"
classpathref="jspc.classpath"/>
    <ant:jasper2
      package="${pom.package}.jsp"
      destDir="${maven.war.src}"
      uriroot="${maven.war.src}"
      srcdir="${maven.war.src}"
      classpathref="jspc.classpath">
      <ant:include name="**/*.jsp"/>
      <ant:exclude name="**/includes/**/*.jsp"/>
    </ant:jasper2>
   </goal>

I have as dependencies:
servlet-api,jasper-compiler,jasper-runtime,jsp-api,catalina-ant,catalina
-deployer

Running this same ant script using just ant, everything works great
(using the Tomcat 5 deployer distribution). Under Maven however, i get a
ClassCast Exception. My guesses here is that the version of Ant packaged
with Maven (im using RC1) and the org.apache.jasper.JspC are not
compatible.

So is there another way to run this from maven? For example can I
replace the Ant jars in $MAVEN_HOME$/lib ? Can I create a build.xml file
that is called from Maven in a separate JVM to accomplish this?

I've tried using the ant:jspc task inside maven.xml, but that is causing
errors as well, and i'm not interested in compiling pages for tomcat 4.

Any suggestions would be greatly appriciated.

Thanks,
jc


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org