You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andy Isaacson (JIRA)" <ji...@codehaus.org> on 2013/01/18 21:57:13 UTC
[jira] (DOXIASITETOOLS-79) APT document with verbatim section
including C #include causes NPE
Andy Isaacson created DOXIASITETOOLS-79:
-------------------------------------------
Summary: APT document with verbatim section including C #include causes NPE
Key: DOXIASITETOOLS-79
URL: https://jira.codehaus.org/browse/DOXIASITETOOLS-79
Project: Maven Doxia Sitetools
Issue Type: Bug
Reporter: Andy Isaacson
Attachments: mtest.tar.gz
A simple apt.vm document including a C program fragment in a verbatim section causes "mvn site" to fail with a NPE. The failure can be worked around by escaping the # as backslash-# but the requirement to do this is not documented, nor AFAICS is the feature of supporting #include in verbatim sections.
Attaching a complete testcase mtest.tar.gz.
{noformat}
% cat src/site/apt/hello.vm
----
#include "stdio.h"
int main(void) { printf("hello, world!\n"); return 0; }
----
% mvn --version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.6.6", arch: "amd64", family: "unix"
% mvn site
...
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[ERROR] Parser Exception: /tmp/mtest/src/site/apt/hello.apt.vm
[ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered "\"stdio.h\"" at line 2, column 13.
Was expecting:
"(" ...
at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3360)
at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3237)
...
[ERROR] ResourceManager.getResource() parse exception
[ERROR] org.apache.velocity.exception.ParseErrorException: Encountered "\"stdio.h\"" at line 2, column 13 of /tmp/mtest/src/site/apt/hello.apt.vm
Was expecting:
"(" ...
at org.apache.velocity.Template.process(Template.java:137)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
...
[ERROR] Error parsing /tmp/mtest/src/site/apt/hello.apt.vm as a velocity template, using as text.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.798s
[INFO] Finished at: Fri Jan 18 12:51:17 PST 2013
[INFO] Final Memory: 11M/153M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project mtest: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed. NullPointerException -> [Help 1]
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIASITETOOLS-79) APT document with verbatim section
including C #include causes NPE
Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIASITETOOLS-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukas Theussl closed DOXIASITETOOLS-79.
---------------------------------------
Resolution: Fixed
Fix Version/s: 1.4
Converted NPE to RendererException: [r1436769|http://svn.apache.org/viewvc?view=revision&revision=1436769]
> APT document with verbatim section including C #include causes NPE
> ------------------------------------------------------------------
>
> Key: DOXIASITETOOLS-79
> URL: https://jira.codehaus.org/browse/DOXIASITETOOLS-79
> Project: Maven Doxia Sitetools
> Issue Type: Bug
> Reporter: Andy Isaacson
> Assignee: Lukas Theussl
> Fix For: 1.4
>
> Attachments: mtest.tar.gz
>
>
> A simple apt.vm document including a C program fragment in a verbatim section causes "mvn site" to fail with a NPE. The failure can be worked around by escaping the # as backslash-# but the requirement to do this is not documented, nor AFAICS is the feature of supporting #include in verbatim sections.
> Attaching a complete testcase mtest.tar.gz.
> {noformat}
> % cat src/site/apt/hello.vm
> ----
> #include "stdio.h"
> int main(void) { printf("hello, world!\n"); return 0; }
> ----
> % mvn --version
> Apache Maven 3.0.4
> Maven home: /usr/share/maven
> Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
> Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.6.6", arch: "amd64", family: "unix"
> % mvn site
> ...
> [WARNING] No project URL defined - decoration links will not be relativized!
> [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
> [ERROR] Parser Exception: /tmp/mtest/src/site/apt/hello.apt.vm
> [ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered "\"stdio.h\"" at line 2, column 13.
> Was expecting:
> "(" ...
>
> at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3360)
> at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3237)
> ...
> [ERROR] ResourceManager.getResource() parse exception
> [ERROR] org.apache.velocity.exception.ParseErrorException: Encountered "\"stdio.h\"" at line 2, column 13 of /tmp/mtest/src/site/apt/hello.apt.vm
> Was expecting:
> "(" ...
>
> at org.apache.velocity.Template.process(Template.java:137)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
> at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
> at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
> ...
> [ERROR] Error parsing /tmp/mtest/src/site/apt/hello.apt.vm as a velocity template, using as text.
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 2.798s
> [INFO] Finished at: Fri Jan 18 12:51:17 PST 2013
> [INFO] Final Memory: 11M/153M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project mtest: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed. NullPointerException -> [Help 1]
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIASITETOOLS-79) APT document with verbatim section
including C #include causes NPE
Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIASITETOOLS-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukas Theussl closed DOXIASITETOOLS-79.
---------------------------------------
Resolution: Not A Bug
Assignee: Lukas Theussl
This only happens when you use filtering (*.vm). In this case the source file is first piped through velocity which doesn't know anything about apt syntax, so you have to escape the velocity special characters.
> APT document with verbatim section including C #include causes NPE
> ------------------------------------------------------------------
>
> Key: DOXIASITETOOLS-79
> URL: https://jira.codehaus.org/browse/DOXIASITETOOLS-79
> Project: Maven Doxia Sitetools
> Issue Type: Bug
> Reporter: Andy Isaacson
> Assignee: Lukas Theussl
> Attachments: mtest.tar.gz
>
>
> A simple apt.vm document including a C program fragment in a verbatim section causes "mvn site" to fail with a NPE. The failure can be worked around by escaping the # as backslash-# but the requirement to do this is not documented, nor AFAICS is the feature of supporting #include in verbatim sections.
> Attaching a complete testcase mtest.tar.gz.
> {noformat}
> % cat src/site/apt/hello.vm
> ----
> #include "stdio.h"
> int main(void) { printf("hello, world!\n"); return 0; }
> ----
> % mvn --version
> Apache Maven 3.0.4
> Maven home: /usr/share/maven
> Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
> Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.6.6", arch: "amd64", family: "unix"
> % mvn site
> ...
> [WARNING] No project URL defined - decoration links will not be relativized!
> [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
> [ERROR] Parser Exception: /tmp/mtest/src/site/apt/hello.apt.vm
> [ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered "\"stdio.h\"" at line 2, column 13.
> Was expecting:
> "(" ...
>
> at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3360)
> at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3237)
> ...
> [ERROR] ResourceManager.getResource() parse exception
> [ERROR] org.apache.velocity.exception.ParseErrorException: Encountered "\"stdio.h\"" at line 2, column 13 of /tmp/mtest/src/site/apt/hello.apt.vm
> Was expecting:
> "(" ...
>
> at org.apache.velocity.Template.process(Template.java:137)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
> at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
> at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
> ...
> [ERROR] Error parsing /tmp/mtest/src/site/apt/hello.apt.vm as a velocity template, using as text.
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 2.798s
> [INFO] Finished at: Fri Jan 18 12:51:17 PST 2013
> [INFO] Final Memory: 11M/153M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project mtest: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed. NullPointerException -> [Help 1]
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIASITETOOLS-79) APT document with verbatim section
including C #include causes NPE
Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIASITETOOLS-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukas Theussl reopened DOXIASITETOOLS-79:
-----------------------------------------
> APT document with verbatim section including C #include causes NPE
> ------------------------------------------------------------------
>
> Key: DOXIASITETOOLS-79
> URL: https://jira.codehaus.org/browse/DOXIASITETOOLS-79
> Project: Maven Doxia Sitetools
> Issue Type: Bug
> Reporter: Andy Isaacson
> Assignee: Lukas Theussl
> Attachments: mtest.tar.gz
>
>
> A simple apt.vm document including a C program fragment in a verbatim section causes "mvn site" to fail with a NPE. The failure can be worked around by escaping the # as backslash-# but the requirement to do this is not documented, nor AFAICS is the feature of supporting #include in verbatim sections.
> Attaching a complete testcase mtest.tar.gz.
> {noformat}
> % cat src/site/apt/hello.vm
> ----
> #include "stdio.h"
> int main(void) { printf("hello, world!\n"); return 0; }
> ----
> % mvn --version
> Apache Maven 3.0.4
> Maven home: /usr/share/maven
> Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
> Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.6.6", arch: "amd64", family: "unix"
> % mvn site
> ...
> [WARNING] No project URL defined - decoration links will not be relativized!
> [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
> [ERROR] Parser Exception: /tmp/mtest/src/site/apt/hello.apt.vm
> [ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered "\"stdio.h\"" at line 2, column 13.
> Was expecting:
> "(" ...
>
> at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3360)
> at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3237)
> ...
> [ERROR] ResourceManager.getResource() parse exception
> [ERROR] org.apache.velocity.exception.ParseErrorException: Encountered "\"stdio.h\"" at line 2, column 13 of /tmp/mtest/src/site/apt/hello.apt.vm
> Was expecting:
> "(" ...
>
> at org.apache.velocity.Template.process(Template.java:137)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
> at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
> at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
> ...
> [ERROR] Error parsing /tmp/mtest/src/site/apt/hello.apt.vm as a velocity template, using as text.
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 2.798s
> [INFO] Finished at: Fri Jan 18 12:51:17 PST 2013
> [INFO] Final Memory: 11M/153M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project mtest: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed. NullPointerException -> [Help 1]
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] (DOXIASITETOOLS-79) APT document with verbatim section
including C #include causes NPE
Posted by "Andy Isaacson (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/DOXIASITETOOLS-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=317726#comment-317726 ]
Andy Isaacson commented on DOXIASITETOOLS-79:
---------------------------------------------
Isn't it a problem that we NPE, though? Some more friendly error message would be nice.
> APT document with verbatim section including C #include causes NPE
> ------------------------------------------------------------------
>
> Key: DOXIASITETOOLS-79
> URL: https://jira.codehaus.org/browse/DOXIASITETOOLS-79
> Project: Maven Doxia Sitetools
> Issue Type: Bug
> Reporter: Andy Isaacson
> Assignee: Lukas Theussl
> Attachments: mtest.tar.gz
>
>
> A simple apt.vm document including a C program fragment in a verbatim section causes "mvn site" to fail with a NPE. The failure can be worked around by escaping the # as backslash-# but the requirement to do this is not documented, nor AFAICS is the feature of supporting #include in verbatim sections.
> Attaching a complete testcase mtest.tar.gz.
> {noformat}
> % cat src/site/apt/hello.vm
> ----
> #include "stdio.h"
> int main(void) { printf("hello, world!\n"); return 0; }
> ----
> % mvn --version
> Apache Maven 3.0.4
> Maven home: /usr/share/maven
> Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
> Java home: /usr/lib/jvm/java-6-openjdk-amd64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "3.6.6", arch: "amd64", family: "unix"
> % mvn site
> ...
> [WARNING] No project URL defined - decoration links will not be relativized!
> [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
> [ERROR] Parser Exception: /tmp/mtest/src/site/apt/hello.apt.vm
> [ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered "\"stdio.h\"" at line 2, column 13.
> Was expecting:
> "(" ...
>
> at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3360)
> at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3237)
> ...
> [ERROR] ResourceManager.getResource() parse exception
> [ERROR] org.apache.velocity.exception.ParseErrorException: Encountered "\"stdio.h\"" at line 2, column 13 of /tmp/mtest/src/site/apt/hello.apt.vm
> Was expecting:
> "(" ...
>
> at org.apache.velocity.Template.process(Template.java:137)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
> at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
> at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
> ...
> [ERROR] Error parsing /tmp/mtest/src/site/apt/hello.apt.vm as a velocity template, using as text.
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 2.798s
> [INFO] Finished at: Fri Jan 18 12:51:17 PST 2013
> [INFO] Final Memory: 11M/153M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project mtest: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed. NullPointerException -> [Help 1]
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira