> The reason is simple - the crimson parser bundled with the JDK's through > 1.4.2(?) is complete crap. Additionally, even older JDK's don't have a > parser bundled, which means you'd have to create multiple maven distros > (one for parser-bundled JDKs and another which accounted for the xml > parser). You're welcome to try to change the parser used by maven of > course, but don't expect much in the way of support. These libraries are > found in $MAVEN_HOME/lib/endorsed, and I believe they may be referenced > specifically in the forehead.conf file in $MAVEN_HOME/bin (not sure > about that, though). I think it's good for maven to offer XML parser library in $MAVEN_HOME/lib/endorsed, but it's not good to specifiy XML parser in maven execution script. Current maven execution script includes this lines: -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
This is unnecessary. Only containing xerces.jar, you can specify default XML parser as Xerces. As you know, JVM's parser factories find parser class name in META-INF/services/javax.xml.parsers.SAXParserFactory and META-INF/services/javax.xml.parsers.DocumentBuilderFactory. If that two lines would be removed in the maven execution script, I can change XML parser by just changing xerces.jar with other library. > One final thought: leaving the parser choice up to the user is the right > thing to do when you're developing an application component which will > run in some java context outside its own. However, this is an > unnecessary and even undesirable level of flexibility for a standalone > tool like maven. It only serves to make installation, configuration and > [especially] support more complex. Current Xerces cannot parse some encodings like MS949. so if I create project.xml with MS949 encoding, maven doesn't work. Some test including parsing MS949 XML document doesn't work, too. There is some alternations like JAXP 1.3(containing xerces with some fixes), but I must modify maven execution script to use them. So I suggest that the two lines be removed from maven execution script.
