Maven
  1. Maven
  2. MNG-2255

Use a external XML Pull parser instead of plexus one

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 3.0-alpha-1
    • Component/s: POM
    • Labels:
      None

      Description

      To avoid maintaining the plexus XMLPullParser we should move to a standard implementation like StaX

      As mentioned in DOXIA-60:

      There's a performance white paper
      http://java.sun.com/performance/reference/whitepapers/StAX-1_0.pdf

      The best implementation seems to be http://woodstox.codehaus.org/

      Another nice set of utilities at http://wiki.java.net/bin/view/Javawsxml/StaxUtilsProject

      The indentator could be used instead of the PrettyPrintXMLWriter

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          959d 16h 27m 1 Jason van Zyl 13/Dec/08 18:28
          Mark Thomas made changes -
          Workflow jira [ 12952551 ] Default workflow, editable Closed status [ 12989876 ]
          Mark Thomas made changes -
          Link This issue relates to MSHARED-255 [ MSHARED-255 ]
          Mark Thomas made changes -
          Link This issue relates to MPLUGIN-229 [ MPLUGIN-229 ]
          Mark Thomas made changes -
          Link This issue relates to DOXIA-60 [ DOXIA-60 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 21:45:26 UTC 2015 [ 1428270326204 ]
          Mark Thomas made changes -
          Workflow jira [ 12712903 ] Default workflow, editable Closed status [ 12755680 ]
          Mark Thomas made changes -
          Link This issue relates to MSHARED-255 [ MSHARED-255 ]
          Mark Thomas made changes -
          Link This issue relates to MPLUGIN-229 [ MPLUGIN-229 ]
          Mark Thomas made changes -
          Link This issue relates to DOXIA-60 [ DOXIA-60 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 08:49:45 UTC 2015 [ 1428223785911 ]
          Hervé Boutemy made changes -
          Link This issue relates to MSHARED-255 [ MSHARED-255 ]
          Hervé Boutemy made changes -
          Link This issue relates to MPLUGIN-229 [ MPLUGIN-229 ]
          Benjamin Bentmann made changes -
          Link This issue is related to MNG-4708 [ MNG-4708 ]
          Brett Porter made changes -
          Fix Version/s 3.0-alpha-1 [ 13143 ]
          Fix Version/s 3.0 [ 13142 ]
          Jason van Zyl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          Hide
          Jason van Zyl added a comment -

          We are now using the StAX parser from the Woodstox project.

          Show
          Jason van Zyl added a comment - We are now using the StAX parser from the Woodstox project.
          Hide
          Brett Porter added a comment -

          this is now in place in the branch for MNG-3397

          Show
          Brett Porter added a comment - this is now in place in the branch for MNG-3397
          Hide
          Stefan Hübner added a comment -

          IMHO: yes, there's the nail's head, Jason.

          Show
          Stefan Hübner added a comment - IMHO: yes, there's the nail's head, Jason.
          Hide
          Jason van Zyl added a comment -

          From looking at the related issues I think the crux of the problem is using a Reader instead of an InputStream.

          Show
          Jason van Zyl added a comment - From looking at the related issues I think the crux of the problem is using a Reader instead of an InputStream.
          Carlos Sanchez made changes -
          Link This issue is related to MNG-2769 [ MNG-2769 ]
          Carlos Sanchez made changes -
          Link This issue supercedes MNG-2715 [ MNG-2715 ]
          Carlos Sanchez made changes -
          Link This issue is related to MNG-2818 [ MNG-2818 ]
          Jason van Zyl made changes -
          Fix Version/s 2.1 [ 11704 ]
          Fix Version/s 2.1.x [ 13142 ]
          Milos Kleint made changes -
          Link This issue is depended upon by MEVENIDE-449 [ MEVENIDE-449 ]
          Carlos Sanchez made changes -
          Link This issue is related to MNG-2593 [ MNG-2593 ]
          Carlos Sanchez made changes -
          Link This issue is related to MNG-2057 [ MNG-2057 ]
          John Casey made changes -
          Fix Version/s 2.0.5 [ 12294 ]
          Fix Version/s 2.1 [ 11704 ]
          Hide
          John Casey added a comment -

          this will require the implementation of a woodstox (or other StaX parser) plugin for Modello, in order to allow us to generate an appropriate model parser.

          Show
          John Casey added a comment - this will require the implementation of a woodstox (or other StaX parser) plugin for Modello, in order to allow us to generate an appropriate model parser.
          Joerg Schaible made changes -
          Link This issue is related to MNG-2362 [ MNG-2362 ]
          Hide
          Carlos Sanchez added a comment -

          Yes, that's part of the solution too

          Show
          Carlos Sanchez added a comment - Yes, that's part of the solution too
          Hide
          Stefan Hübner added a comment -

          Hm, just a thought, but:

          To me it seems that the parser used to read in maven's model isn't the problem really. It's more likely the way the POM is handed to the parser.

          Have a look to class org.apache.maven.model.io.xpp3.MavenXpp3Reader which is generated by maven-model. This MavenXpp3Reader is invoked via read-method with one parameter. This parameter is a Reader and that, to me, is problematic. Problematic because there's no way once you have a Reader on some inputsource (i.e. a stream) to change that reader's handling of character encodings on it's underlying stream. So, as long as reading the model is invoked by handing a Reader to some parser the parser won't be able to adapt to the actual POM's encoding.

          As a conclusion I would recommend model parser should be handed a stream rather than a Reader-instance working on the underlying POM.

          I don't know if other parsers can cope with that situation, but XMLPullParser doesn't. It would though, if it is given a stream on the POM, but I don't know which wider implications this would cause.

          What do you think?

          Show
          Stefan Hübner added a comment - Hm, just a thought, but: To me it seems that the parser used to read in maven's model isn't the problem really. It's more likely the way the POM is handed to the parser. Have a look to class org.apache.maven.model.io.xpp3.MavenXpp3Reader which is generated by maven-model. This MavenXpp3Reader is invoked via read-method with one parameter. This parameter is a Reader and that, to me, is problematic. Problematic because there's no way once you have a Reader on some inputsource (i.e. a stream) to change that reader's handling of character encodings on it's underlying stream. So, as long as reading the model is invoked by handing a Reader to some parser the parser won't be able to adapt to the actual POM's encoding. As a conclusion I would recommend model parser should be handed a stream rather than a Reader-instance working on the underlying POM. I don't know if other parsers can cope with that situation, but XMLPullParser doesn't. It would though, if it is given a stream on the POM, but I don't know which wider implications this would cause. What do you think?
          Carlos Sanchez made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          Fix Version/s 2.0.5 [ 12294 ]
          Hide
          Carlos Sanchez added a comment -

          Seems by related issues that people is having a lot of trouble with encodings

          Show
          Carlos Sanchez added a comment - Seems by related issues that people is having a lot of trouble with encodings
          Carlos Sanchez made changes -
          Link This issue is related to MNG-2254 [ MNG-2254 ]
          Carlos Sanchez made changes -
          Link This issue supercedes PLX-214 [ PLX-214 ]
          Carlos Sanchez made changes -
          Field Original Value New Value
          Link This issue is related to DOXIA-60 [ DOXIA-60 ]
          Carlos Sanchez created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Carlos Sanchez
            • Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development