|
Certain compilation errors can be hard to track down; for example when compiling the attached two jspc files (one of which has an error, one doesn't), the Maven output is as follows (even with the -e flag);
C:\jspctest> mvn clean package
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
...
...
[INFO] — jspc-maven-plugin:2.0-alpha-3:compile (default) @ jspctest —
Created dir: C:\jspctest\target\jsp-source
[INFO] Compiling JSP source files to C:\jspctest\target/jsp-source
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.965s
[INFO] Finished at: Mon Dec 17 10:14:08 GMT 2012
[INFO] Final Memory: 12M/165M
[INFO] ------------------------------------------------------------------------
[ERROR] Unable to compile class for JSP:
[ERROR]
[ERROR] An error occurred at line: 7 in the generated java file
[ERROR] Syntax error on token "import", Identifier expected after this token
[ERROR]
[ERROR] Stacktrace:
[ERROR] -> [Help 1]
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 7 in the generated java file
Syntax error on token "import", Identifier expected after this token
Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
at org.apache.jasper.JspC.processFile(JspC.java:1010)
at org.apache.jasper.JspC.execute(JspC.java:1159)
at org.codehaus.mojo.jspc.compiler.tomcat6.JspCompilerImpl.compile(JspCompilerImpl.java:111)
Note that there is no indication of the name of the file with the error. With only two to pick from in the attached, it's easy to work out which is working. But with a major project, it can be very hard to track down the problematic file (in this case, an extra comma in the import statement).
[NB. Based on my understanding of how this works, I'm entirely sure this problem can be fixed without changing the underlying jspc. But I'm raising it just in case ...]
|