Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Jetty/Feature/Jetty Jspc Maven Plugin
Contents
Jetty Jspc Maven Plugin
This plugin will help you pre-compile your jsps and works in conjunction with the maven war plugin to put them inside an assembled war.
Configuration
Here's the basic setup required to put the jspc plugin into your build:
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-jspc-maven-plugin</artifactId> <version>7.0.0</version> <executions> <execution> <id>jspc</id> <goals> <goal>jspc</goal> </goals> <configuration> </configuration> </execution> </executions> </plugin>
Configurable Parameters
The configurable parameters are
Parameter Name | Default Value | Meaning |
---|---|---|
webXmlFragment | "${basedir}/target/webfrag.xml" | File into which to generate the servlet declarations. Will be merged with an existing web.xml. |
packageRoot | "jsp" | Default root package name for all generated classes. |
webAppSourceDirectory | "${basedir}/src/main/webapp" | Root of resources directory where jsps, tags etc are located. |
webXml | "${basedir}/src/main/webapp/WEB-INF/web.xml" | The web.xml file to use to merge with the generated fragments. |
includes | "**\/*.jsp, **\/*.jspx" | xx |
excludes | "**\/.svn\/**" | xx |
classesDirectory | "${project.build.outputDirectory}" | x |
generatedClasses | "${project.build.outputDirectory}" | x |
keepSources | false | xx |
validateXml | false | x |
suppressSmap | true | x |
ignoreJspFragmentErrors | false | x |
schemaResourcePrefix | x | |
insertionMarker | x | |
verbose | false | x |
mergeFragment | true | x |
Taking all the default settings, here's how to configure the war plugin to use the generated web.xml that includes all of the jsp servlet declarations:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webXml>${basedir}/target/web.xml</webXml> </configuration> </plugin>