Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
JSPC Maven Plugin 2.3.2
-
None
-
None
Description
In a legacy project, there are Poms and ddl files on the class path. When I try to run the JSPC Maven Plugin on this project, then the plugin fails with
[INFO] --- jspc-maven-plugin:2.3.2:jspc (compile-jsp) @ demo-project --- [ERROR] Compilation Failure org.apache.sling.scripting.jsp.jasper.JasperException: java.util.zip.ZipException: zip END header not found at org.apache.sling.maven.jspc.JspcMojo.executeInternal (JspcMojo.java:469) at org.apache.sling.maven.jspc.JspcMojo.execute (JspcMojo.java:315) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.util.zip.ZipException: zip END header not found at java.util.zip.ZipFile$Source.zerror (ZipFile.java:1607) at java.util.zip.ZipFile$Source.findEND (ZipFile.java:1497) at java.util.zip.ZipFile$Source.initCEN (ZipFile.java:1504) at java.util.zip.ZipFile$Source.<init> (ZipFile.java:1308) at java.util.zip.ZipFile$Source.get (ZipFile.java:1271) at java.util.zip.ZipFile$CleanableResource.<init> (ZipFile.java:733) at java.util.zip.ZipFile$CleanableResource.get (ZipFile.java:850) at java.util.zip.ZipFile.<init> (ZipFile.java:248) at java.util.zip.ZipFile.<init> (ZipFile.java:177) at java.util.jar.JarFile.<init> (JarFile.java:348) at java.util.jar.JarFile.<init> (JarFile.java:319) at java.util.jar.JarFile.<init> (JarFile.java:285) at org.apache.sling.maven.jspc.JspcMojo.containsProblematicPackage (JspcMojo.java:613) at org.apache.sling.maven.jspc.JspcMojo.initClassLoader (JspcMojo.java:585) at org.apache.sling.maven.jspc.JspcMojo.initServletContext (JspcMojo.java:520) at org.apache.sling.maven.jspc.JspcMojo.executeInternal (JspcMojo.java:404) at org.apache.sling.maven.jspc.JspcMojo.execute (JspcMojo.java:315) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
My expectation would be that the plugin would ignore such files (I know that the root cause is the crappy class path ) to make it robuster.
The responsible method is org.apache.sling.maven.jspc.JspcMojo.containsProblematicPackage (JspcMojo.java:613).