Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-148

PluginXdocGenerator generates poorly formed output when default values contain XML

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.3, 2.5
    • 2.5.1
    • API
    • None
    • Patch

    Description

      Due to changes made in revision 684062, PluginXDocGenerator no longer handles defalultValues properly. Before, the routines depended on org.codehaus.plexus.util.xml.PrettyPrintXMLWriter's method writeText (which escaped XML). Since the change to using pure ResourceBundle interpolation, the values are no longer escaped. The following excerpt shows the offending changes:

      <pre>
      — maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java 2008/08/08 19:24:21 684061
      +++ maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java 2008/08/08 19:28:52 684062
      ...
      @@ -532,15 +526,13 @@
      }
      else

      { - description = getBundle( locale ).getString( "pluginxdoc.nodescription" ); + description = getString( "pluginxdoc.nodescription" ); }

      w.writeMarkup( description + "<br/>" );

      if ( StringUtils.isNotEmpty( parameter.getDefaultValue() ) )

      { - w.writeMarkup( "<strong>" + getBundle( locale ).getString( "pluginxdoc.mojodescriptor.parameter.defaultValue" ) + "</strong>: <code>" ); - w.writeText( parameter.getDefaultValue() ); - w.writeMarkup( "</code>." ); + w.writeMarkup( format( "pluginxdoc.mojodescriptor.parameter.defaultValue", parameter.getDefaultValue() ) ); }

      w.endElement();//td
      w.endElement(); //tr
      </pre>

      Attachments

        1. MPLUGIN-148.patch
          2 kB
          Brent Atkinson

        Activity

          People

            bentmann Benjamin Bentmann
            batkinson Brent Atkinson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: