HHH-12231 Have the provisioned WildFly server apply an override to JPA 2.2 API

This commit is contained in:
Sanne Grinovero 2018-01-22 02:07:59 +00:00
parent a185c3a33d
commit dd5e25fe9c
1 changed files with 7 additions and 19 deletions

View File

@ -8,7 +8,7 @@ import org.apache.tools.ant.filters.ReplaceTokens
*/ */
plugins { plugins {
id "org.wildfly.build.provision" version "0.0.2" id "org.wildfly.build.provision" version "0.0.3"
} }
apply from: rootProject.file( 'gradle/base-information.gradle' ) apply from: rootProject.file( 'gradle/base-information.gradle' )
@ -37,7 +37,6 @@ ext {
// "10" for WildFly 10.x, "11" for 11.x, etc // "10" for WildFly 10.x, "11" for 11.x, etc
wildFlyMajorVersion = project.wildflyVersion.split( '\\.' )[0] wildFlyMajorVersion = project.wildflyVersion.split( '\\.' )[0]
wildFlyJPA22PatchVersion = '1.0.0.Beta1'
artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist" artifactClassifier = "wildfly-${wildFlyMajorVersion}-dist"
@ -70,12 +69,16 @@ configurations {
provision { provision {
destinationDir = file("$project.wildFlyInstallDir") destinationDir = file("$project.wildFlyInstallDir")
override( 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api' ) {
groupId = 'javax.persistence'
artifactId = 'javax.persistence-api'
version = '2.2'
}
} }
dependencies { dependencies {
jipijapa "org.wildfly:jipijapa-hibernate5:${wildflyVersion}" jipijapa "org.wildfly:jipijapa-hibernate5:${wildflyVersion}"
byteBuddy libraries.byteBuddy byteBuddy libraries.byteBuddy
wildflyJPA22Patch "org.hibernate.javax.persistence:hibernate-jpa-api-2.2-wildflymodules:${wildFlyJPA22PatchVersion}:wildfly-${wildflyVersion}-patch@zip"
testCompile project( ":hibernate-core" ) testCompile project( ":hibernate-core" )
testCompile project( ":hibernate-envers" ) testCompile project( ":hibernate-envers" )
@ -167,23 +170,8 @@ task release( dependsOn: createModulesZip )
task installWildFly( dependsOn: [createModulesZip, provision] ) { task installWildFly( dependsOn: [createModulesZip, provision] ) {
description = 'Downloads the WildFly distribution, installs it into a local directory, includes present version of Hibernate ORM, JPA 2.2 : ready for integration tests' description = 'Downloads the WildFly distribution, installs it into a local directory, includes present version of Hibernate ORM, JPA 2.2 : ready for integration tests'
final File patchFile = configurations.wildflyJPA22Patch.resolvedConfiguration.resolvedArtifacts[0].file
inputs.file( patchFile )
doLast { doLast {
// until we have a version of WF supporting EE 8 (JPA 2.2), we need to patch // install the Hibernate ORM modules from the current build
// the install to support JPA 2.2
def executableExtension = (System.properties['os.name'].toLowerCase().contains('windows')) ? 'bat' : 'sh'
exec {
ignoreExitValue = true
executable "$project.wildFlyInstallDir/bin/jboss-cli." + executableExtension
args "patch apply $patchFile.absolutePath --override-all"
}
// and then install the Hibernate ORM modules from the current build
copy { copy {
duplicatesStrategy DuplicatesStrategy.EXCLUDE duplicatesStrategy DuplicatesStrategy.EXCLUDE
from zipTree( createModulesZip.archivePath ) from zipTree( createModulesZip.archivePath )