Skip to content

Commit

Permalink
HHH-12946 Enable JAXB dependencies regardless of the JDK being used w…
Browse files Browse the repository at this point in the history
…hen 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.
  • Loading branch information
yrodiere authored and gsmet committed Sep 11, 2019
1 parent b6bad94 commit a69de05
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 32 deletions.
28 changes: 12 additions & 16 deletions hibernate-core/hibernate-core.gradle
Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions hibernate-osgi/hibernate-osgi.gradle
Expand Up @@ -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' ) )

Expand Down
26 changes: 10 additions & 16 deletions tooling/metamodel-generator/hibernate-jpamodelgen.gradle
Expand Up @@ -17,24 +17,18 @@ ext {
}

dependencies {
testCompile libraries.junit
testCompile libraries.jpa
testCompile project( ':hibernate-core' )

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Java 9 ftw!
if ( JavaVersion.current().isJava9Compatible() ) {
compile( libraries.jaxb_api )
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 )
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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' )
}

sourceSets.main {
Expand Down

0 comments on commit a69de05

Please sign in to comment.