Uploaded image for project: 'Maven Doxia Sitetools'
  1. Maven Doxia Sitetools
  2. DOXIASITETOOLS-79

APT document with verbatim section including C #include causes NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.4
    • None
    • None

    Description

      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.

      % 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]
      

      Attachments

        1. mtest.tar.gz
          0.8 kB
          Aditya Kishore

        Issue Links

          Activity

            People

              ltheussl Lukas Theussl
              adi Aditya Kishore
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: