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