This is an automated email from the ASF dual-hosted git repository.
pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-jspc-maven-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new b1c923f SLING-9453: compile in parallel and add an option to supress
smap generation.
b1c923f is described below
commit b1c923f2474063ca5b78993f4abc451e76956d9f
Author: Karl Pauls <[email protected]>
AuthorDate: Thu May 14 23:59:15 2020 +0200
SLING-9453: compile in parallel and add an option to supress smap
generation.
---
.../java/org/apache/sling/maven/jspc/JspcMojo.java | 33 +++++++++++++---------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
b/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
index 7080afb..c52eb08 100644
--- a/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
+++ b/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java
@@ -110,6 +110,9 @@ public class JspcMojo extends AbstractMojo implements
Options {
@Parameter ( property = "jspc.jasper.trimSpaces", defaultValue = "false")
private boolean jasperTrimSpaces;
+ @Parameter ( property = "jspc.jasper.suppressSmap", defaultValue = "false")
+ private boolean jasperSuppressSmap;
+
@Parameter ( property = "jspc.failOnError", defaultValue = "true")
private boolean failOnError;
@@ -285,7 +288,7 @@ public class JspcMojo extends AbstractMojo implements
Options {
+ uriSourceRoot + "' must be an existing directory");
}
- for (String nextjsp : pages) {
+ pages.stream().parallel().forEach(nextjsp -> {
File fjsp = new File(nextjsp);
if (!fjsp.isAbsolute()) {
fjsp = new File(uriRootF, nextjsp);
@@ -294,18 +297,22 @@ public class JspcMojo extends AbstractMojo implements
Options {
if (getLog().isWarnEnabled()) {
getLog().warn("JSP file " + fjsp + " does not exist");
}
- continue;
- }
- String s = fjsp.getAbsolutePath();
- if (s.startsWith(uriSourceRoot)) {
- nextjsp = s.substring(uriSourceRoot.length());
- }
- if (nextjsp.startsWith("." + File.separatorChar)) {
- nextjsp = nextjsp.substring(2);
- }
+ } else {
+ String s = fjsp.getAbsolutePath();
+ if (s.startsWith(uriSourceRoot)) {
+ nextjsp = s.substring(uriSourceRoot.length());
+ }
+ if (nextjsp.startsWith("." + File.separatorChar)) {
+ nextjsp = nextjsp.substring(2);
+ }
- processFile(nextjsp);
- }
+ try {
+ processFile(nextjsp);
+ } catch (JasperException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
} catch (JasperException je) {
Throwable rootCause = je;
@@ -741,7 +748,7 @@ public class JspcMojo extends AbstractMojo implements
Options {
*/
public boolean isSmapSuppressed() {
// require SMAP
- return false;
+ return jasperSuppressSmap;
}
/*