For JDK 11 specifics, I do it directly in the build.gradle:
if (JavaVersion.current().isJava11Compatible()) {
// JAXB removed from JDK 11
dependencies {
"com.sun.xml.bind:jaxb-impl:2.3.3"
}
}
I have already read the official docs, and used the links you referenced to solve my ivy-maven mixed repositories problems.
I should have been more explicit in the title, but what I want to achieve cannot be expressed without Gradle metadata (i.e. it can’t be expressed in Maven nor Ivy), hence the variants & capabilities reference in the question.
However, after reading and experimenting, I must have missed something as I can’t find a simple way to express the constraints I have mentioned.
(And thanks for the cross-post reference, after one week without an answer, I tried my luck on SO)