Fork me on GitHub

jspc:compile

Full name:

io.leonard.maven.plugins:jspc-maven-plugin:4.2.1-SNAPSHOT:compile

Description:

This goal will compile jsps for a webapp so that they can be included in a war.

It is a fork of jetty-jspc-maven-plugin but has the following improvements:

  • Faster: ability of multi-threading see threads parameter
  • Not stop at the first error : see stopAtFirstError parameter

The compiler used in this plugin the Apache Jasper 9.0.12 but it can be overloaded.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: process-classes.

Optional Parameters

Name Type Since Description
<classesDirectory> File - The location of the compiled classes for the webapp
Default: ${project.build.outputDirectory}
<compilerClass> String - Name of the compiler class used to compile the jsp files. If threads parameter is greater than 2, then maybe the compilerClass "org.apache.jasper.compiler.ParallelJDTCompiler" will be more efficient
Default: org.apache.jasper.compiler.JDTCompiler
<compilerVersion> String - Version of Java used to compile the jsp files.
Default: 1.8
<defaultTldScan> Boolean - Controls if JARs are scanned or skipped by default when scanning for TLDs. See StandardJarScanFilter.
See also: Standard implementation
<enableJspTagPooling> boolean - Whether Jsp Tag Pooling should be enabled.
Default: true
<excludes> String[] - The comma separated list of file name patters to exclude from compilation.
Default: **\/.svn\/**
<generatedClasses> String - The destination directory into which to put the compiled jsps.
Default: ${project.build.outputDirectory}
<genStringAsCharArray> boolean - Should text strings be generated as char arrays, to improve performance in some cases?
Default: false
<httpNoProxyHosts> String - Optionnal no proxy hosts (use when validating dtd/xsd with external URL)
A list of hosts that should be reached directly, bypassing the proxy.
This is a list of patterns separated by '|'.
The patterns may start or end with a '*' for wildcards.
Any host matching one of these patterns will be reached through a direct connection instead of through a proxy.
See https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
<httpProxyHost> String - Optionnal hostname of http proxy (use when validating dtd/xsd with external URL)
<httpProxyPort> String - Optionnal port of http proxy (use when validating dtd/xsd with external URL)
<ignoreJspFragmentErrors> boolean - Whether or not to ignore precompilation errors caused by jsp fragments.
Default: false
<includes> String[] - The comma separated list of patterns for file extensions to be processed. By default will include all .jsp and .jspx files.
Default: **\/*.jsp, **\/*.jspx, **\/*.jspf
<insertionMarker> String - Optional. A marker string in the src web.xml file which indicates where to merge in the generated web.xml fragment. Note that the marker string will NOT be preserved during the insertion. Can be left blank, in which case the generated fragment is inserted just before the </web-app> line
<javaEncoding> String - The encoding scheme to use.
Default: UTF-8
<keepSources> boolean - Controls whether or not .java files generated during compilation will be preserved.
Default: false
<mergeFragment> boolean - Merge the generated fragment file with the web.xml from webAppSourceDirectory. The merged file will go into the same directory as the webXmlFragment.
Default: true
<packageRoot> String - Default root package for all generated classes
Default: jsp
<skip> boolean - Set this to 'true' to bypass compilation of JSP sources.
Default: false
User Property: jspc.skip
<stopAtFirstError> boolean - Fail the build and stop at the first jspc error. If set to "false", all jsp will be compiled even if they raise errors, and all errors will be listed when they raise. In this case the build will fail too. In case of threads > 1 and stopAtFirstError=true, each thread can have is own first error.
Default: true
<strictQuoteEscaping> boolean - When scriptlet expressions are used for attribute values, should the rules in JSP.1.6 for the escaping of quote characters be strictly applied? Default [true]
Default: true
<suppressSmap> boolean - Whether or not to generate JSR45 compliant debug info
Default: true
<threads> int - The number of threads will be used for compile all of the jsps. Number total of jsps will be divided by thread number. Each part will be given to differents thread.
Default: 1
<tldScan> String - The comma separated list of JAR file name patterns to scan when scanning for tag libraries (TLDs). See StandardJarScanFilter.
See also: Standard implementation
<tldSkip> String - The comma separated list of JAR file name patterns to skip when scanning for tag libraries (TLDs). See StandardJarScanFilter.
See also: Standard implementation
<trimSpaces> String - Should white spaces in template text between actions or directives be trimmed?
Default: false
<validateWebXmlAfterMerge> boolean - If true, validates web.xml file (xml format) after beeing merge if mergeFragment parameter is true
Default: true
<validateWebXmlWithXsdAfterMerge> boolean - If true, validates web.xml file (xsd see webXmlXsdSchema parameter) after beeing merge if mergeFragment parameter is true
Default: false
<validateXml> boolean - If true, validates tlds when parsing.
Default: false
<verbose> boolean - Whether or not to output more verbose messages during compilation.
Default: false
<webAppSourceDirectory> String - Root directory for all html/jsp etc files
Default: ${basedir}/src/main/webapp
<webXml> String - Location of web.xml. Defaults to src/main/webapp/web.xml.
Default: ${basedir}/src/main/webapp/WEB-INF/web.xml
<webXmlFragment> String - File into which to generate the <servlet> and <servlet-mapping> tags for the compiled jsps.

If multithreading mode is active (threads > 1), then this filename will be suffixed by ".threadIndex" (example : webfrag.xml.3).


Default: ${basedir}/target/webfrag.xml
<webXmlXsdSchema> String - The link to xsd schema to validate web xml file after merging, if mergeFragment parameter is true.
Default: http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd

Parameter Details

<classesDirectory>

The location of the compiled classes for the webapp
  • Type: java.io.File
  • Required: report.plugin.goal.no
  • Default: ${project.build.outputDirectory}

<compilerClass>

Name of the compiler class used to compile the jsp files. If threads parameter is greater than 2, then maybe the compilerClass "org.apache.jasper.compiler.ParallelJDTCompiler" will be more efficient
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: org.apache.jasper.compiler.JDTCompiler

<compilerVersion>

Version of Java used to compile the jsp files.
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: 1.8

<defaultTldScan>

Controls if JARs are scanned or skipped by default when scanning for TLDs. See StandardJarScanFilter.
See also: Standard implementation
  • Type: java.lang.Boolean
  • Required: report.plugin.goal.no

<enableJspTagPooling>

Whether Jsp Tag Pooling should be enabled.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: true

<excludes>

The comma separated list of file name patters to exclude from compilation.
  • Type: java.lang.String[]
  • Required: report.plugin.goal.no
  • Default: **\/.svn\/**

<generatedClasses>

The destination directory into which to put the compiled jsps.
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: ${project.build.outputDirectory}

<genStringAsCharArray>

Should text strings be generated as char arrays, to improve performance in some cases?
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<httpNoProxyHosts>

Optionnal no proxy hosts (use when validating dtd/xsd with external URL)
A list of hosts that should be reached directly, bypassing the proxy.
This is a list of patterns separated by '|'.
The patterns may start or end with a '*' for wildcards.
Any host matching one of these patterns will be reached through a direct connection instead of through a proxy.
See https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
  • Type: java.lang.String
  • Required: report.plugin.goal.no

<httpProxyHost>

Optionnal hostname of http proxy (use when validating dtd/xsd with external URL)
  • Type: java.lang.String
  • Required: report.plugin.goal.no

<httpProxyPort>

Optionnal port of http proxy (use when validating dtd/xsd with external URL)
  • Type: java.lang.String
  • Required: report.plugin.goal.no

<ignoreJspFragmentErrors>

Whether or not to ignore precompilation errors caused by jsp fragments.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<includes>

The comma separated list of patterns for file extensions to be processed. By default will include all .jsp and .jspx files.
  • Type: java.lang.String[]
  • Required: report.plugin.goal.no
  • Default: **\/*.jsp, **\/*.jspx, **\/*.jspf

<insertionMarker>

Optional. A marker string in the src web.xml file which indicates where to merge in the generated web.xml fragment. Note that the marker string will NOT be preserved during the insertion. Can be left blank, in which case the generated fragment is inserted just before the </web-app> line
  • Type: java.lang.String
  • Required: report.plugin.goal.no

<javaEncoding>

The encoding scheme to use.
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: UTF-8

<keepSources>

Controls whether or not .java files generated during compilation will be preserved.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<mergeFragment>

Merge the generated fragment file with the web.xml from webAppSourceDirectory. The merged file will go into the same directory as the webXmlFragment.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: true

<packageRoot>

Default root package for all generated classes
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: jsp

Set this to 'true' to bypass compilation of JSP sources.
  • Type: boolean
  • Required: report.plugin.goal.no
  • User Property: jspc.skip
  • Default: false

<stopAtFirstError>

Fail the build and stop at the first jspc error. If set to "false", all jsp will be compiled even if they raise errors, and all errors will be listed when they raise. In this case the build will fail too. In case of threads > 1 and stopAtFirstError=true, each thread can have is own first error.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: true

<strictQuoteEscaping>

When scriptlet expressions are used for attribute values, should the rules in JSP.1.6 for the escaping of quote characters be strictly applied? Default [true]
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: true

<suppressSmap>

Whether or not to generate JSR45 compliant debug info
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: true

<threads>

The number of threads will be used for compile all of the jsps. Number total of jsps will be divided by thread number. Each part will be given to differents thread.
  • Type: int
  • Required: report.plugin.goal.no
  • Default: 1

<tldScan>

The comma separated list of JAR file name patterns to scan when scanning for tag libraries (TLDs). See StandardJarScanFilter.
See also: Standard implementation
  • Type: java.lang.String
  • Required: report.plugin.goal.no

<tldSkip>

The comma separated list of JAR file name patterns to skip when scanning for tag libraries (TLDs). See StandardJarScanFilter.
See also: Standard implementation
  • Type: java.lang.String
  • Required: report.plugin.goal.no

<trimSpaces>

Should white spaces in template text between actions or directives be trimmed?
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: false

<validateWebXmlAfterMerge>

If true, validates web.xml file (xml format) after beeing merge if mergeFragment parameter is true
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: true

<validateWebXmlWithXsdAfterMerge>

If true, validates web.xml file (xsd see webXmlXsdSchema parameter) after beeing merge if mergeFragment parameter is true
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<validateXml>

If true, validates tlds when parsing.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<verbose>

Whether or not to output more verbose messages during compilation.
  • Type: boolean
  • Required: report.plugin.goal.no
  • Default: false

<webAppSourceDirectory>

Root directory for all html/jsp etc files
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: ${basedir}/src/main/webapp

<webXml>

Location of web.xml. Defaults to src/main/webapp/web.xml.
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: ${basedir}/src/main/webapp/WEB-INF/web.xml

<webXmlFragment>

File into which to generate the <servlet> and <servlet-mapping> tags for the compiled jsps.

If multithreading mode is active (threads > 1), then this filename will be suffixed by ".threadIndex" (example : webfrag.xml.3).

  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: ${basedir}/target/webfrag.xml

<webXmlXsdSchema>

The link to xsd schema to validate web xml file after merging, if mergeFragment parameter is true.
  • Type: java.lang.String
  • Required: report.plugin.goal.no
  • Default: http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd