Classloader issue related to java.xml.bind
in ArtifactTransform
#29114
Labels
a:bug
in:artifact-transforms
to-triage
👋 team-triage
Issues that need to be triaged by a specific team
Current Behavior
I was trying to use
javax.xml.bind
in a plugin I’m developing. I see issues related to missing classes when I try to run in Java 11, but these only happen in a part of the code that uses JAXB and not in others.I'm running it on both Java 8 and Java 11. Since JAXB is not part of the JDK anymore from Java 9, I added a dependency in the plugin build:
I have two places in my plugin where I use JAXB. One place is in a task:
I can execute this task without any problems.
The other place where I use JAXB is in an artifact transform:
When the artifact transform gets executed, I get:
Expected Behavior
I would expect the dependency to be enough. I discussed this here in the Gradle forum with @Vampire and he suggested I open an issue.
Context (optional)
I switched to using a newer version of JAXB, which works on both Java 8 and 11 (version 3.0.2), but this required changing the namespace as well. I'm not blocked by the issue, but would like to understand whether I'm doing something wrong or whether something can be improved in Gradle.
Steps to Reproduce
I see the issue in this commit of my plugin: tudortimi/gradle-hdvl@3347a4e
To reproduce, after cloning that repo and selecting the commit, with Java 11 installed, run:
Gradle version
8.7
Build scan URL (optional)
https://scans.gradle.com/s/2micrd4yj3ahe
Your Environment (optional)
Java 11
The text was updated successfully, but these errors were encountered: