Maven 1.x XDoc Plugin
  1. Maven 1.x XDoc Plugin
  2. MPXDOC-136

Integration tests bug (NullPointerException)

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Labels:
      None
    • Environment:
      SVN revision 157841 for core and 157848 for plugin
    • Number of attachments :
      2

      Description

      When upgrading Maven to 1.1 Snapshot, I encountered a malicious bug with integration tests.

      Calling this goal works very well:
      maven-1\plugins\trunk\xdoc>maven plugin:test
      ...
      BUILD SUCCESSFUL

      But this goal doesn't work:
      maven-1\plugins\trunk\xdoc\src\plugin-test>maven testPlugin
      ...
      BUILD FAILED
      File...... \maven-1\plugins\trunk\xdoc\src\plugin-test\maven.xml
      Element... maven:reactor
      Line...... 20
      Column.... 127
      Unable to obtain goal [test-xdoc] – C:\Documents and Settings\Siveton
      Vincent\.maven\cache\maven-xdoc-plugin-1.9-SNAPSHOT\plugin.jelly:502:13:
      <velocity:merge>
      Invocation of method 'getText' in class org.apache.velocity.anakia.Escape
      threw exception class java.lang.NullPointerException : null
      Total time: 24 seconds

      Further investigation shows that a property (project.issueTrackingUrl) is not properly set when processing the xdoc template folder. It seems to be a problem of inheriting properties. See:
      $escape.getText($project.issueTrackingUrl)) in the issue-tracking.xml file

      Solutions proposal:
      Adding this following line in each project.xml from plugin-test src:
      <issueTrackingUrl>http://jira.codehaus.org/browse/MPXDOC</issueTrackingUrl>

      A best way is to check directly the null property in the xdoc file. For instance, in the issue-tracking.xml file:
      #if ($$project.issueTrackingUrl && $$project.issueTrackingUrl.length() != 0)
      #set ($url = $escape.getText($repository.url))
      ...
      #end

      Moreover, in the same idea, I think another bug can be found in the code: cvs-usage.xml or cvs.xml file with the property $repository.url:
      $escape.getText($repository.url)

      1. MPXDOC-136-cvs-usage.xml.diff
        0.5 kB
        Arnaud Heritier
      2. MPXDOC-136-issue-tracking.diff
        0.7 kB
        Arnaud Heritier

        Activity

        Hide
        Arnaud Heritier added a comment -

        Fixed. Thanks.

        Show
        Arnaud Heritier added a comment - Fixed. Thanks.
        Hide
        Arnaud Heritier added a comment -

        I didn't remember that I needed to close an issue. Resolve it was sufficient before.

        Show
        Arnaud Heritier added a comment - I didn't remember that I needed to close an issue. Resolve it was sufficient before.
        Hide
        Arnaud Heritier added a comment -

        Same error if the url isn't defined in the repository, but I remember to have already fixed it

        Show
        Arnaud Heritier added a comment - Same error if the url isn't defined in the repository, but I remember to have already fixed it
        Hide
        Arnaud Heritier added a comment -

        test if repository.url exists before to use it

        Show
        Arnaud Heritier added a comment - test if repository.url exists before to use it
        Hide
        Arnaud Heritier added a comment -

        Fix re-applied

        Show
        Arnaud Heritier added a comment - Fix re-applied
        Hide
        Arnaud Heritier added a comment -

        Similar error with project.issueTrackingUrl in issue-tracking.xml

        Show
        Arnaud Heritier added a comment - Similar error with project.issueTrackingUrl in issue-tracking.xml
        Hide
        Arnaud Heritier added a comment -

        Fix the use of project.issueTrackingUrl

        Show
        Arnaud Heritier added a comment - Fix the use of project.issueTrackingUrl
        Hide
        Arnaud Heritier added a comment -

        another fix for this problem

        Show
        Arnaud Heritier added a comment - another fix for this problem

          People

          • Assignee:
            Arnaud Heritier
            Reporter:
            Vincent Siveton
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: