Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-878

Avoid dependencies on xerces.impl

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Done
    • Jena 2.13.0
    • Jena 2.13.0
    • Jena
    • None

    Description

      Building jena-osgi complains about xerces.impl dependencies:

      > [WARNING] Bundle org.apache.jena:jena-osgi:bundle:2.12.2-SNAPSHOT : Unused
      > Private-Package instructions, no such package(s) on the class path: [!*]
      > [WARNING] Bundle org.apache.jena:jena-osgi:bundle:2.12.2-SNAPSHOT : Export
      > com.hp.hpl.jena.datatypes.xsd, has 1, private references
      > [org.apache.xerces.impl.dv],

      stain@biggie-utopic:~/src/jena/jena-core/src/main/java/com/hp/hpl/jena/datatypes$ grep -r xerces.*impl .
      ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.* ;
      ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.util.Base64 ;
      ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.util.HexBin ;
      ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.xs.DecimalDV ;
      ./xsd/XSDDatatype.java:import org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl ;
      ./xsd/XSDDatatype.java:import org.apache.xerces.impl.validation.ValidationState ;
      ./xsd/XSDhexBinary.java:import org.apache.xerces.impl.dv.util.HexBin ;
      ./xsd/XSDbase64Binary.java:import org.apache.xerces.impl.dv.util.Base64 ;
      ./xsd/impl/XSDGenericType.java:import org.apache.xerces.impl.dv.XSSimpleType;
      

      It is not good style to depend on *.impl of a package - it is liable to fall over at some point. jena-osgi complains, but works in this particular case, because xercesImpl is shadowed in.

      Some/all of these (base64) are available through more official packages - org.apache.commons.codec.binary.Base64 comes to mind.

      https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html
      https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Hex.html

      So this task suggests to replace these dependencies with commons-codec versions. Remember to add commons-codec to jena-osgi as well!

      Attachments

        Activity

          People

            andy Andy Seaborne
            soilandreyes Stian Soiland-Reyes (old) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: