HHH-12946 Enable JAXB dependencies regardless of the JDK being used when building Hibernate ORM

Previously we would only add the dependency when building with JDK9+,
and we built all releases using JDK8.
This means the dependencies were useless, because they would never be
mentioned in the actual POMs published to users.
This commit is contained in:
Yoann Rodière 2018-10-15 12:15:41 +02:00 committed by Guillaume Smet
parent b6bad94914
commit a69de05e44
3 changed files with 25 additions and 32 deletions

View File

@ -24,21 +24,6 @@ configurations {
dependencies {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java 9 ftw!
if ( JavaVersion.current().isJava9Compatible() ) {
compile( libraries.jaxb_api )
compile( libraries.jaxb_runtime )
xjc( libraries.jaxb_runtime )
xjc( libraries.jaxb_xjc )
xjc( libraries.jaxb2_basics )
xjc( libraries.jaxb2_basics_ant )
xjc( libraries.activation )
xjc( libraries.jsr250_api )
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compile( libraries.jpa )
// Javassist is no longer the default enhancer but still required for other purposes, e.g. Scanning
compile( libraries.javassist )
@ -58,6 +43,16 @@ dependencies {
compile( libraries.commons_annotations )
antlr( libraries.antlr )
// JAXB
compile( libraries.jaxb_api )
compile( libraries.jaxb_runtime )
xjc( libraries.jaxb_runtime )
xjc( libraries.jaxb_xjc )
xjc( libraries.jaxb2_basics )
xjc( libraries.jaxb2_basics_ant )
xjc( libraries.activation )
xjc( libraries.jsr250_api )
provided( libraries.jacc )
provided( libraries.validation )
provided( libraries.ant )
@ -132,7 +127,8 @@ jar {
'javax.enterprise.context.spi;resolution:=optional',
'javax.enterprise.inject.spi;resolution:=optional',
'javax.inject;resolution:=optional',
'net.bytebuddy.*;resolution:=optional'
'net.bytebuddy.*;resolution:=optional',
'javax.xml.bind.*'
// // TODO: Uncomment once EntityManagerFactoryBuilderImpl no longer
// // uses ClassLoaderServiceImpl.

View File

@ -56,6 +56,9 @@ dependencies {
// this dependency wasn't there in the 5.2.x bundles so ignoring it for now
// we might reintroduce it at some point if users complain about it
exclude module: 'javax.activation-api'
// TODO HHH-13022 Find a way to include JAXB in the OSGi feature
exclude module: 'jaxb-api'
exclude module: 'jaxb-runtime'
}
testCompile( project( ':hibernate-envers' ) )

View File

@ -17,24 +17,18 @@ ext {
}
dependencies {
testCompile libraries.junit
compile( libraries.jaxb_api )
xjc( libraries.jaxb_runtime )
xjc( libraries.jaxb_xjc )
xjc( libraries.jaxb2_basics )
xjc( libraries.jaxb2_basics_ant )
xjc( libraries.activation )
xjc( libraries.jsr250_api )
testCompile libraries.junit
testCompile libraries.jpa
testCompile project( ':hibernate-core' )
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java 9 ftw!
if ( JavaVersion.current().isJava9Compatible() ) {
compile( libraries.jaxb_api )
xjc( libraries.jaxb_runtime )
xjc( libraries.jaxb_xjc )
xjc( libraries.jaxb2_basics )
xjc( libraries.jaxb2_basics_ant )
xjc( libraries.activation )
xjc( libraries.jsr250_api )
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
sourceSets.main {