Colm O hEigeartaigh created CXFXJC-52:
-----------------------------------------

             Summary: Replace xml-resolver with javax.xml.catalog in 
cxf-xjc-plugin
                 Key: CXFXJC-52
                 URL: https://issues.apache.org/jira/browse/CXFXJC-52
             Project: CXF XJC Utils
          Issue Type: Improvement
            Reporter: Colm O hEigeartaigh
             Fix For: 4.3.0


{{XSDToJavaRunner}} in {{cxf-xjc-plugin}} uses Apache xml-resolver 1.2 
({{{}org.apache.xml.resolver.CatalogManager{}}} / 
{{{}tools.CatalogResolver{}}}) to handle the {{catalog}} option. It overrides 
{{Options.addCatalog()}} mainly so that catalog entries can point at 
{{classpath:}} URLs, which are resolved against the plugin’s classloader.

xml-resolver has had no release since 2006. Stock XJC’s own catalog handling 
({{{}com.sun.tools.xjc.CatalogUtil{}}}) already uses the JDK’s 
{{javax.xml.catalog}} API, which is part of the JDK on our Java 17 baseline.

Proposed change:
 * Build the resolver with 
{{{}javax.xml.catalog.CatalogManager.catalogResolver(...){}}}, using 
{{RESOLVE=continue}} so that an unmatched entry returns null as it does today.
 * Keep the existing {{classpath:}} handling by turning resolved {{classpath:}} 
URIs into classloader resources.
 * Remove the {{xml-resolver:xml-resolver}} dependency from 
{{{}cxf-xjc-plugin{}}}.

Compatibility note: {{javax.xml.catalog}} only reads OASIS XML catalogs 
(namespace {{{}urn:oasis:names:tc:entity:xmlns:xml:catalog{}}}). It doesn’t 
read the old text format (TR9401). Users with text catalogs would need to 
convert them, and the release notes should say so.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to