I just added jspc plugin to my project yesterday. And I'm having some
limited success. The JSPs are getting compiled (woohoo) but the
web.xml modification piece is not working as documented.
Here's the contents of my pom:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-compiler</artifactId>
<version>5.5.12</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>tomcat</groupId>
<artifactId>jasper-runtime</artifactId>
<version>5.5.12</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<webXml>${basedir}/target/${pom.artifactId}-${pom.version}/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
And I added this to my web.xml file as directed by the plugin documentation:
</servlet>
<!-- [INSERT FRAGMENT HERE] -->
The actual JSPs are getting compiled which is great.
But my web.xml in target ends up empty, 0 bytes, so something isn't
working quite right.
Anyone else using JSPC and having better success??
Wayne
On 3/17/06, Tom Joad <[EMAIL PROTECTED]> wrote:
> I have just resolved all my problems using jspc plugin. I report it
> here if it can help.
>
> 1) about error
> file:/myproject/WebContent/WEB-INF/tags/html/attributes.tag(13,7)
> <%@ tag directive can only be used in a tag file.
>
> I have on my web.xml project lines
> <jsp-config>
> ...
> <jsp-property-group>
> <url-pattern>*.tag</url-pattern>
> <el-ignored>false</el-ignored>
> <page-encoding>UTF-8</page-encoding>
> <scripting-invalid>true</scripting-invalid>
> <is-xml>false</is-xml>
> </jsp-property-group>
> </jsp-config>
> I don't know if actually these lines are important , not being a
> developer , but
> When i put them under comment , I didn't get error anymore.
>
>
> 2°) about error posted below
>
> I saw on the log file a variable "extension" withe value
> ${JAVA_HOME}/jre/lib/ext
> jspc tries to find tools.jar under this directory and doesn't use the
> one provided by the sytem dependency defined inside pom.xml.
> So i had to copy here tools.jar
> new problems appeared. I got errors about lack of dependency
> with servlet-api and tomcat .jasper runtime , I declared inside
> pom.xml with provided scope because i did'nt want to bundle them under
> WEB-INF/lib.
> I had to use compile scope for the two artifacts . and now i have
> them packaged with my war file.
>
> I wonder if everything who used this plugin , had as many problems.
> Or i really have a bad luck.
>
> Tom.
>
>
>
>
> 2006/3/17, Tom Joad <[EMAIL PROTECTED]>:
> > Hello all,
> > I use jspc plugin to precompile my jsp files.
> > I get the following error
> >
> > - ERROR-the file '\WEB-INF\pages\home.jsp' generated the following
> > general exception:
> > Unable to find a javac compiler;
> > com.sun.tools.javac.Main is not on the classpath.
> > Perhaps JAVA_HOME does not point to the JDK
> >
> > However I put lines
> > <dependency>
> > <groupId>sun.jdk</groupId>
> > <artifactId>tools</artifactId>
> > <scope>system</scope>
> > <version>1.5</version>
> > <systemPath>${java.home}/../lib/tools.jar</systemPath>
> > </dependency>
> >
> > on my pom.xml.
> > Any Ideas?
> >
> > Thanks
> >
> > Tom.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>