Make use of narayana Jakarta artifacts

This commit is contained in:
Christian Beikov 2021-05-07 09:50:35 +02:00
parent 0750c6784e
commit a8f00b00aa
6 changed files with 122 additions and 202 deletions

View File

@ -141,10 +141,8 @@ ext {
jodaTime: "joda-time:joda-time:${jodaTimeVersion}",
informix: 'com.ibm.informix:jdbc:4.10.12',
jboss_jta: "org.jboss.narayana.jta:narayana-jta:5.11.1.Final",
// todo: update the version when the parent pom is published
jboss_tx_spi: "org.jboss:jboss-transaction-spi:7.6.0.Final",
// todo (jakarta): update the version when it is released
jboss_jta: "org.jboss.narayana.jta:narayana-jta:5.11.2.Final",
jboss_tx_spi: "org.jboss:jboss-transaction-spi:7.6.1.Final",
jboss_jta_jakarta: "org.jboss.narayana.jta:narayana-jta-jakarta:5.11.2.Final",
jboss_tx_spi_jakarta: "org.jboss:jboss-transaction-spi-jakarta:7.6.1.Final",
xapool: "com.experlog:xapool:1.5.0",

View File

@ -48,48 +48,47 @@ dependencies {
'org.eclipse.transformer:org.eclipse.transformer:0.2.0',
'org.eclipse.transformer:org.eclipse.transformer.cli:0.2.0'
// todo: enable again when we can finally use the Jakarta JARs from narayana
// testCompile( project(':hibernate-testing-jakarta') )
// testCompile fileTree(dir: 'libs', include: '*.jar')
//
// testCompile( libraries.shrinkwrap_api )
// testCompile( libraries.shrinkwrap )
// testCompile( libraries.jakarta_jacc )
// testCompile( libraries.jakarta_validation )
// testCompile( libraries.jandex )
// testCompile( libraries.classmate )
// testCompile( libraries.mockito )
// testCompile( libraries.mockito_inline )
// testCompile( libraries.jodaTime )
// testCompile( libraries.assertj )
//
// testCompile( libraries.jakarta_cdi )
//
// testCompile( libraries.jakarta_validator ) {
// // for test runtime
// transitive = true
// }
//
// // for testing stored procedure support
// testCompile( libraries.derby )
//
// testRuntime( "org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:1.0.0.Final" )
// testRuntime( libraries.jakarta_el )
// testRuntime( 'jaxen:jaxen:1.1' )
// testRuntime( libraries.javassist )
// testRuntime( libraries.byteBuddy )
// testRuntime( libraries.jakarta_weld )
// testRuntime( libraries.atomikos )
// testRuntime( libraries.atomikos_jta )
//// todo (jakarta): replace this when the jakarta artifact is released
// testRuntime( project(':hibernate-transaction-client') )
//// testRuntime( libraries.wildfly_transaction_client_jakarta )
//
// testCompile libraries.shrinkwrap_descriptors_api_javaee
// testCompile libraries.shrinkwrap_descriptors_impl_javaee
//
// testCompile libraries.jboss_ejb_spec_jar
// testCompile libraries.jboss_annotation_spec_jar
testCompile( project(':hibernate-testing-jakarta') )
testCompile fileTree(dir: 'libs', include: '*.jar')
testCompile( libraries.shrinkwrap_api )
testCompile( libraries.shrinkwrap )
testCompile( libraries.jakarta_jacc )
testCompile( libraries.jakarta_validation )
testCompile( libraries.jandex )
testCompile( libraries.classmate )
testCompile( libraries.mockito )
testCompile( libraries.mockito_inline )
testCompile( libraries.jodaTime )
testCompile( libraries.assertj )
testCompile( libraries.jakarta_cdi )
testCompile( libraries.jakarta_validator ) {
// for test runtime
transitive = true
}
// for testing stored procedure support
testCompile( libraries.derby )
testRuntime( "org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:1.0.0.Final" )
testRuntime( libraries.jakarta_el )
testRuntime( 'jaxen:jaxen:1.1' )
testRuntime( libraries.javassist )
testRuntime( libraries.byteBuddy )
testRuntime( libraries.jakarta_weld )
testRuntime( libraries.atomikos )
testRuntime( libraries.atomikos_jta )
// todo (jakarta): replace this when the jakarta artifact is released
testRuntime( project(':hibernate-transaction-client') )
// testRuntime( libraries.wildfly_transaction_client_jakarta )
testCompile libraries.shrinkwrap_descriptors_api_javaee
testCompile libraries.shrinkwrap_descriptors_impl_javaee
testCompile libraries.jboss_ejb_spec_jar
testCompile libraries.jboss_annotation_spec_jar
}
jar {
@ -134,52 +133,51 @@ jar {
}
}
// todo: enable again when we can finally use the Jakarta JARs from narayana
//task unpackTestJar(type: Copy) {
// dependsOn jar
// fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
// def outputDir = file("${buildDir}/unpacked/" + it.name)
// from zipTree(it)
// into outputDir
// }
//}
//
//task copyBundleResources (type: Copy) {
// dependsOn unpackTestJar
// File unpackedDir = new File(project.buildDir, "libs/hibernate-core-jakarta-${project.version}-test.jar")
// ext {
// bundlesTargetDir = file( "${buildDir}/bundles" )
// bundleTokens = dbBundle[db]
// ext.bundleTokens['buildDirName'] = buildDir.absolutePath
// }
//
// from file("${buildDir}/unpacked/${unpackedDir.name}/templates")
// into ext.bundlesTargetDir
// filter( ReplaceTokens, tokens: ext.bundleTokens)
// doFirst {
// ext.bundlesTargetDir.mkdirs()
// }
//}
//
//processTestResources.dependsOn copyBundleResources
//
//artifacts {
// tests new File(project.buildDir, "libs/hibernate-core-jakarta-${project.version}-test.jar")
//}
//
//test {
// fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
// def outputDir = file("${buildDir}/unpacked/" + it.name)
// testClassesDirs += files(outputDir)
// classpath += files(outputDir)
// }
// systemProperty 'file.encoding', 'utf-8'
//
// if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) {
// // See org.hibernate.boot.model.naming.NamingHelperTest.DefaultCharset.set
// jvmArgs( ['--add-opens', 'java.base/java.nio.charset=ALL-UNNAMED'] )
// // Weld needs this to generate proxies
// jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
// jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )
// }
//}
task unpackTestJar(type: Copy) {
dependsOn jar
fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
def outputDir = file("${buildDir}/unpacked/" + it.name)
from zipTree(it)
into outputDir
}
}
task copyBundleResources (type: Copy) {
dependsOn unpackTestJar
File unpackedDir = new File(project.buildDir, "libs/hibernate-core-jakarta-${project.version}-test.jar")
ext {
bundlesTargetDir = file( "${buildDir}/bundles" )
bundleTokens = dbBundle[db]
ext.bundleTokens['buildDirName'] = buildDir.absolutePath
}
from file("${buildDir}/unpacked/${unpackedDir.name}/templates")
into ext.bundlesTargetDir
filter( ReplaceTokens, tokens: ext.bundleTokens)
doFirst {
ext.bundlesTargetDir.mkdirs()
}
}
processTestResources.dependsOn copyBundleResources
artifacts {
tests new File(project.buildDir, "libs/hibernate-core-jakarta-${project.version}-test.jar")
}
test {
fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
def outputDir = file("${buildDir}/unpacked/" + it.name)
testClassesDirs += files(outputDir)
classpath += files(outputDir)
}
systemProperty 'file.encoding', 'utf-8'
if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) {
// See org.hibernate.boot.model.naming.NamingHelperTest.DefaultCharset.set
jvmArgs( ['--add-opens', 'java.base/java.nio.charset=ALL-UNNAMED'] )
// Weld needs this to generate proxies
jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )
}
}

View File

@ -29,9 +29,8 @@ dependencies {
'org.eclipse.transformer:org.eclipse.transformer.cli:0.2.0'
testCompile( project( ':hibernate-envers-jakarta' ) )
// todo: enable again when we can finally use the Jakarta JARs from narayana
// testCompile( project( ':hibernate-testing-jakarta' ) )
// testCompile( project( path: ':hibernate-core-jakarta', configuration: 'tests' ) )
testCompile( project( ':hibernate-testing-jakarta' ) )
testCompile( project( path: ':hibernate-core-jakarta', configuration: 'tests' ) )
}
jar {
@ -76,30 +75,29 @@ jar {
}
}
// todo: enable again when we can finally use the Jakarta JARs from narayana
//task unpackTestJar(type: Copy) {
// dependsOn jar
// fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
// def outputDir = file("${buildDir}/unpacked/" + it.name)
// from zipTree(it)
// into outputDir
// }
//}
//
//test {
// dependsOn unpackTestJar
// fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
// def outputDir = file("${buildDir}/unpacked/" + it.name)
// testClassesDirs += files(outputDir)
// classpath += files(outputDir)
// }
// systemProperty 'file.encoding', 'utf-8'
//
// if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) {
// // See org.hibernate.boot.model.naming.NamingHelperTest.DefaultCharset.set
// jvmArgs( ['--add-opens', 'java.base/java.nio.charset=ALL-UNNAMED'] )
// // Weld needs this to generate proxies
// jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
// jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )
// }
//}
task unpackTestJar(type: Copy) {
dependsOn jar
fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
def outputDir = file("${buildDir}/unpacked/" + it.name)
from zipTree(it)
into outputDir
}
}
test {
dependsOn unpackTestJar
fileTree(project.buildDir).matching { include 'libs/*-test.jar' }.each {
def outputDir = file("${buildDir}/unpacked/" + it.name)
testClassesDirs += files(outputDir)
classpath += files(outputDir)
}
systemProperty 'file.encoding', 'utf-8'
if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) {
// See org.hibernate.boot.model.naming.NamingHelperTest.DefaultCharset.set
jvmArgs( ['--add-opens', 'java.base/java.nio.charset=ALL-UNNAMED'] )
// Weld needs this to generate proxies
jvmArgs( ['--add-opens', 'java.base/java.security=ALL-UNNAMED'] )
jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] )
}
}

View File

@ -1,70 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
description = 'JBoss JTA transformed to be JTA 2.0 compatible'
apply from: rootProject.file( 'gradle/published-java-module.gradle' )
tasks.withType(PublishToMavenRepository) {
onlyIf {
repository.name == "MavenLocal"
}
}
configurations {
jakartaeeTransformJars
}
dependencies {
compile( libraries.jakarta_jta )
compile( libraries.jakarta_resource )
compile( libraries.jboss_tx_spi_jakarta )
jakartaeeTransformJars 'biz.aQute.bnd:biz.aQute.bnd.transform:5.1.1',
'commons-cli:commons-cli:1.4',
'org.slf4j:slf4j-simple:1.7.30',
'org.slf4j:slf4j-api:1.7.26',
'org.eclipse.transformer:org.eclipse.transformer:0.2.0',
'org.eclipse.transformer:org.eclipse.transformer.cli:0.2.0'
testCompile ( libraries.jboss_jta ) {
transitive=false;
}
}
jar {
def sourceJarPath = project.configurations.testCompile.find { it.name.startsWith("narayana-jta-") }
inputs.files(sourceJarPath).skipWhenEmpty()
outputs.dir project.buildDir
doLast {
new File(project.buildDir, "libs").mkdirs()
fileTree(project.buildDir).matching { include 'libs/*.jar' }.each { delete it }
println 'Initial bundle jar name [ ' + sourceJarPath + ' ]'
def finalBundleJarName = project.buildDir.path + '/libs/hibernate-jboss-jta-' + project.version + ".jar"
println 'Default jakarta final bundle jar name [ ' + finalBundleJarName + ' ]'
def transformerArgs = [
sourceJarPath, finalBundleJarName,
'-q', // quiet output
'-tr', new File(getProjectDir().getParentFile(), 'rules/jakarta-renames.properties').path,
'-tv', new File(getProjectDir().getParentFile(), 'rules/jakarta-versions.properties').path,
'-td', new File(getProjectDir().getParentFile(), 'rules/jakarta-direct.properties').path,
]
println 'Transformer options:'
transformerArgs.each {
println ' [ ' + it + ' ]'
}
javaexec {
classpath configurations.jakartaeeTransformJars
main = 'org.eclipse.transformer.jakarta.JakartaTransformer'
args = transformerArgs
}
}
}

View File

@ -28,14 +28,12 @@ dependencies {
compile( libraries.byteman_bmunit )
compile( libraries.xapool )
compile( libraries.log4j )
// todo (jakarta): replace this when the jakarta artifacts are released
compile project( ':hibernate-jboss-jta' )
compile( libraries.jboss_tx_spi_jakarta ) {
transitive=false;
}
// compile ( libraries.jboss_jta_jakarta ) {
// transitive=false;
// }
compile ( libraries.jboss_jta_jakarta ) {
transitive=false;
}
jakartaeeTransformJars 'biz.aQute.bnd:biz.aQute.bnd.transform:5.1.1',
'commons-cli:commons-cli:1.4',

View File

@ -91,8 +91,6 @@ include 'hibernate-core-jakarta'
include 'hibernate-entitymanager'
include 'hibernate-testing'
include 'hibernate-testing-jakarta'
// todo (jakarta): remove these two when the jakarta artifacts are released
include 'hibernate-jboss-jta'
include 'hibernate-transaction-client'
include 'hibernate-envers'