Skip to content

Commit

Permalink
Add plugin goals back to the generated site.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmsilva committed Feb 14, 2024
1 parent 317e5f2 commit cb68f5d
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 33 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ If the Jasper compiler version needs to be overloaded, the plugin must be config
<version>${ENTER_JASPER_VERSION_HERE}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>4.6.1</version>
<version>3.36.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
33 changes: 8 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
<maven.site.plugin.version>3.12.1</maven.site.plugin.version>
<maven.site.plugin.version>4.0.0-M13</maven.site.plugin.version>
<maven.plugin.plugin.version>3.11.0</maven.plugin.plugin.version>
<maven.plugin.reporting.plugin.version>3.10.2</maven.plugin.reporting.plugin.version>
<maven.project.info.reports.plugin.version>3.5.0</maven.project.info.reports.plugin.version>
<maven.version>3.9.6</maven.version>
<java.compilation.level>11</java.compilation.level>
<tomcat.version>10.1.18</tomcat.version>
Expand All @@ -46,7 +48,7 @@
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
Expand All @@ -56,18 +58,6 @@
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${tomcat.version}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>4.6.1</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -330,24 +320,17 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven.site.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>${maven.plugin.plugin.version}</version>
<artifactId>maven-plugin-report-plugin</artifactId>
<version>${maven.plugin.reporting.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<dependencyLocationEnabled>false</dependencyLocationEnabled>
</configuration>
<version>${maven.project.info.reports.plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>team</report>
<report>mailing-lists</report>
<report>ci-management</report>
Expand Down
101 changes: 101 additions & 0 deletions src/site/markdown/howto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# How to use

Add the plugin to the build as shown below:

```xml
<build>
...
<plugin>
<groupId>io.leonard.maven.plugins</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<version>${ENTER_VERSION_HERE}</version>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
</plugin>
...
</build>
```

## Overriding Jasper

To override the Jasper plugin used to compile the JSP files configure the plugin as shown below:

```xml
<build>
....
<plugin>
<groupId>io.leonard.maven.plugins</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<version>${ENTER_VERSION_HERE}</version>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
<configuration />
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${ENTER_JASPER_VERSION_HERE}</version>
</dependency>
</dependencies>
</plugin>
...
</build>
```

## Overriding ECJ

To override the Eclipse compiler for Java used to compile the Java files that Jasper generates configure the plugin as shown below.
Newer versions of ECJ typically support newer JVMs and bytecode versions.

```xml
<build>
....
<plugin>
<groupId>io.leonard.maven.plugins</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<version>${ENTER_VERSION_HERE}</version>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
<configuration />
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${ENTER_JASPER_VERSION_HERE}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.36.0</version>
</dependency>
</dependencies>
</plugin>
...
</build>
```
22 changes: 22 additions & 0 deletions src/site/markdown/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# jspc-maven-plugin

This plugin precompiles JSPs.

It has the following improvements compared to jetty-jspc-maven-plugin:

* Faster: can be configured to run multi-threaded. For a speed comparison read the blog post below.
* More descriptive error messages: Under Maven 3 this plugin shows a clear indication of what caused the error and which file it is in.
* Not stop at the first error (depends on plugin configuration).

The compiler used by default in this plugin is Apache Jasper 10, but it can be swapped.

## Compatibility Matrix

* 4.X version of jspc-maven-plugin : needs Java >= 11, Jasper only 10.X
* 3.X version of jspc-maven-plugin : needs Java >= 1.8, Jasper only 9.X
* 2.X version of jspc-maven-plugin : needs Java >= 1.7, Jasper only 8.X
* 1.X version of jspc-maven-plugin : needs Java >= 1.5, Jasper only 6.X, 7.X

## Comparison of precompiler plugins

[https://tcollignon.github.io/2016/12/04/How-to-compile-JSP-with-Tomcat-and-Maven-faster.html](https://tcollignon.github.io/2016/12/04/How-to-compile-JSP-with-Tomcat-and-Maven-faster.html)
28 changes: 23 additions & 5 deletions src/site/site.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
<project name="jspc maven plugin">
<?xml version="1.0" encoding="UTF-8"?>
<site xmlns="http://maven.apache.org/SITE/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SITE/2.0.0 https://maven.apache.org/xsd/site-2.0.0.xsd"
name="JSPC Maven Plugin">

<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.6</version>
<version>2.0.0-M8</version>
</skin>

<body>
<menu ref="reports" />
<menu name="Overview">
<item name="Introduction" href="index.html"/>
<item name="How to" href="howto.html"/>
<item name="Goals" href="plugin-info.html"/>
</menu>
<menu ref="reports"/>
</body>

</project>
<custom>
<fluidoSkin>
<gitHub>
<projectId>leonardehrenfried/jspc-maven-plugin</projectId>
<ribbonOrientation>right</ribbonOrientation>
<ribbonColor>gray</ribbonColor>
</gitHub>
</fluidoSkin>
</custom>

</site>

0 comments on commit cb68f5d

Please sign in to comment.