Pre-compile JSP pages for Apache Geronimo with Maven

In Apache Geronimo 2.2/w tomcat 6 they don’t appear to be using the tomcat jasper JSP compiler. So to pre-compile JSP pages you will need to modify the dependencies of the jspc maven compiler.

<plugin>
    <groupId>org.codehaus.mojo.jspc</groupId>
    <artifactId>jspc-maven-plugin</artifactId>
    <version>2.0-alpha-3</version>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.mojo.jspc</groupId>
            <artifactId>jspc-compiler-tomcat6</artifactId>
            <version>2.0-alpha-3</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper-el</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jasper-jdt</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>el-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>annotations-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.ext.tomcat</groupId>
            <artifactId>jasper</artifactId>
            <version>6.0.29.0</version>
        </dependency>
    </dependencies>
    <configuration>
        <inputwebxml>${project.basedir}/target/${project.artifactId}-${project.version}/WEB-INF/web.xml</inputwebxml>
        <sources>
            <directory>${project.basedir}/target/${project.artifactId}-${project.version}</directory>
            <includes>
                <include>**/*.jsp</include>
            </includes>
        </sources>
    </configuration>
</plugin>

Comments are closed.