Invalid character in plugin.xml
-------------------------------

                 Key: MOUNCE-7
                 URL: https://jira.codehaus.org/browse/MOUNCE-7
             Project: Maven 2.x Ounce Plugin
          Issue Type: Bug
         Environment: JDK 6u25, Ubuntu
            Reporter: Jesse Glick


While running a parser on {{META-INF/maven/plugin.xml}} in 
{{~/.m2/repository/org/codehaus/mojo/ounce-maven-plugin/1.2/ounce-maven-plugin-1.2.jar}}
 I got:

{noformat}
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 
Invalid byte 2 of 2-byte UTF-8 sequence.
        at 
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
        at 
com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:369)
        at 
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
        at 
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:487)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2687)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at 
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
        at 
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284){noformat}

Inspecting the XML file, I saw the problem at line 215:

{noformat}
based on the application name and timestamp and saves it to the 
application&#65533;s working directory.</description>
{noformat}

This character (Windows-encoded apostrophe?) is not valid in UTF-8 encoding. 
(Which is the fallback encoding used for the file as produced by 
{{maven-plugin-plugin 2.3}}; {{2.8}} seems to specify {{encoding="UTF-8"}} but 
still writes out garbage.) Can be tracked back to a bad source file:

{noformat}
Index: ounce-maven-plugin/src/main/java/org/codehaus/mojo/ounce/ScanMojo.java
===================================================================
--- ounce-maven-plugin/src/main/java/org/codehaus/mojo/ounce/ScanMojo.java      
(revision 14241)
+++ ounce-maven-plugin/src/main/java/org/codehaus/mojo/ounce/ScanMojo.java      
(working copy)
@@ -67,7 +67,7 @@
 
     /**
      * A filename to which to save the assessment. <br/> If filename is not 
specified, Ounce/Maven generates a name
-     * based on the application name and timestamp and saves it to the 
applications working directory.
+     * based on the application name and timestamp and saves it to the 
application's working directory.
      * 
      * @parameter expression="${ounce.assessmentOutput}"
      */
{noformat}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to