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

DefaultSiteRenderer must use Package#getImplementationVersion to check for Doxia Sitetools prerequisite

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.3
    • 1.7.4
    • Site renderer
    • None

    Description

      Issue raised on the mailing list with a sample project issue has been reproduced.

      The reason is that the prerequisite for the Sitetools are validated against:

      Package p = DefaultSiteRenderer.class.getPackage();
      String current = ( p == null ) ? null : p.getSpecificationVersion();
      

      but the specification for the value of SpecificationVersion is major.minor. This was broken for some years and finally fixed with MSHARED-191. This likely creeped into the module.

      Proposed patch:

      Index: DefaultSiteRenderer.java
      ===================================================================
      --- DefaultSiteRenderer.java	(revision 1768577)
      +++ DefaultSiteRenderer.java	(working copy)
      @@ -803,7 +803,7 @@
                           skinModel.getPrerequisites() == null ? null : skinModel.getPrerequisites().getDoxiaSitetools();
       
                       Package p = DefaultSiteRenderer.class.getPackage();
      -                String current = ( p == null ) ? null : p.getSpecificationVersion();
      +                String current = ( p == null ) ? null : p.getImplementationVersion();
       
                       if ( StringUtils.isNotBlank( toolsPrerequisite ) && ( current != null )
                           && !matchVersion( current, toolsPrerequisite ) )
      

      works flawlessly with the sample project.

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              michael-o Michael Osipov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: