On 12/11/2019 23:45, Plugins wrote:
Gradle makes heavy use a lot of stuff in the javax.xml.* and org.w3c.*
packages internally [1] And, again, this shaded jar we're talking about
is generated on demand — IFF a Gradle plugin author happens to have
applied a specific internal Gradle plugin that is only ever applied to
assist in the development of custom Gradle plugins. So this api jar is
not actually „distributed“ in the same sense that other artifacts
are normally „distributed“ — through a public repository, say.

I can't say with 100% certainty, but I _think_ everything contained in
this shaded JAR is expected to never show up on the classpath(s) of end
users of my plugin for example.

So I think you're right, Alan. Those xml-apis dependencies in that
shaded JAR are probably just one of a ton of other rebundled internal
dependencies that Gradle itself needs to support the plugin development
use case.

I've no doubt that Gradle is making use of the XML processing and W3C DOM APIs but they are provided by the JDK so I don't know why Gradle 6.0 includes xml-apis-1.4.01.jar in its distribution. If you run with `-Xlog:class+load` then I assume none of the javax.xml.* and org.w3c.* classes are loaded from this JAR file, this goes for JDK 8 and older too.

I took a quite look at xml-apis-1.4.01.jar and it looks like a copy of the XML API classes (not the implementation) from a very old JDK or JAXP release. The class files v45.3 = JDK 1.0.2 :-) The class files seems to have been compiled in Dec 2009 and I suspect were compiled from the JAXP API classes that were in Java SE 6 (one of the classes defines a method that was added in Java SE 6). So my guess is that this JAR file has been obsolete for a long time. It may have been used for deployments on JDK 5 or older that could upgrade the JDK but want to use newer versions of the XML APIs. Alternatively, maybe it was useful for the period when the JDK didn't include the all of the W3C API.

Hopefully someone from Gradle can comment on this issue, my guess is that xml-apis is not needed.

-Alan

Reply via email to