Skip to content

Commit

Permalink
HHH-9699 - Re-work the hibernate-osgi integration tests using managed…
Browse files Browse the repository at this point in the history
… Karaf
  • Loading branch information
sebersole committed May 12, 2015
1 parent f3247cf commit ab66df1
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -23,7 +23,7 @@ buildscript {
classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:1.0.0-SNAPSHOT'
classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0'
classpath 'org.hibernate.build.gradle:gradle-xjc-plugin:1.0.2.Final'
classpath 'com.github.lburgazzoli:lb-karaf-features-gen:1.0.0.SNAPSHOT'
classpath 'com.github.lburgazzoli:lb-karaf-features-gen:1.0.0-SNAPSHOT'
}
}

Expand Down
171 changes: 146 additions & 25 deletions hibernate-osgi/hibernate-osgi.gradle
Expand Up @@ -18,6 +18,22 @@ configurations {
aries {
description = 'Runtime dependencies for Aries for the hibernate-jpa-aries Karaf feature'
}
hibernateEntityManager {
description = 'Used in Karaf feature generation to define the Hibernate JPA dependencies'
transitive = false
}
hibernateEnvers {
description = 'Used in Karaf feature generation to define the Hibernate Envers dependencies'
transitive = false
}
hibernateEhcache {
description = 'Used in Karaf feature generation to define the Hibernate Ehcache dependencies'
transitive = false
}
hibernateInfinispan {
description = 'Used in Karaf feature generation to define the Hibernate Infinispan dependencies'
transitive = false
}
}

ext {
Expand Down Expand Up @@ -58,6 +74,11 @@ dependencies {

karafDistro "org.apache.karaf:apache-karaf:${karafVersion}@tar.gz"

hibernateEntityManager project( ':hibernate-entitymanager' )
hibernateEnvers project( ':hibernate-envers' )
hibernateEhcache project( ':hibernate-ehcache' )
hibernateInfinispan project( ':hibernate-infinispan' )

aries 'org.apache.aries.transaction:org.apache.aries.transaction.blueprint:1.0.0'
aries 'org.apache.aries.transaction:org.apache.aries.transaction.manager:1.0.1'
}
Expand Down Expand Up @@ -107,50 +128,140 @@ task generateVersionFile {

karafFeatures {
features {
// NOTE : would like to include spatial as well, but we need to wait for
// it to not define dependency on postgresql driver
hibernateNative {
name = 'hibernate-native'
hibernateBase {
name = 'hibernate-base'
description = 'Isolates all Hibernate core dependencies into a single feature'
projects = [
rootProject.childProjects.'hibernate-core',
project
]
bundle {
match {
group = 'org.jboss.logging'
module = 'jboss-logging-annotations'
}
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-processor'
include = false
}
bundle {
match group: 'antlr', module: 'antlr'
remap group: 'org.apache.servicemix.bundles', module: 'org.apache.servicemix.bundles.antlr', version: '2.7.7_5'
}
bundle {
match group: 'dom4j', module: 'dom4j'
remap group: 'org.apache.servicemix.bundles', module: 'org.apache.servicemix.bundles.dom4j', version: '1.6.1_5'
}
}
hibernateNative {
name = 'hibernate-native'
description = 'Defines support for using Hibernate native APIs (SessionFactory, Session) in user applications/bundles'
dependencyFeatureNames = ['hibernate-base']
projects = []
}
hibernateJpa {
name = 'hibernate-jpa'
projects = [
rootProject.childProjects.'hibernate-entitymanager',
project
]
description = 'Defines support for using Hibernate JPA implementation in user applications/bundles in an unmanaged manner'
bundleDependencies = [project.configurations.hibernateEntityManager]
dependencyFeatureNames = ['hibernate-base']
projects = []
}
hibernateJpaAries {
name = 'hibernate-jpa-aries'
projects = [
rootProject.childProjects.'hibernate-entitymanager',
project
]
extraBundleDependencies = [project.configurations.aries]
description = 'Defines support for using Hibernate JPA implementation in user applications/bundles in an managed manner using Aries for OSGi JPA support'
bundleDependencies = [project.configurations.aries, project.configurations.hibernateEntityManager]
dependencyFeatureNames = ['hibernate-base']
projects = []
}
// NOTE : would like to include spatial as well, but we need to wait for
// it to not define dependency on postgresql driver
hibernateEnvers {
name = 'hibernate-envers'
projects = [
rootProject.childProjects.'hibernate-envers',
project
]
description = 'Feature for easily adding Envers support to hibernate-native, hibernate-jpa or hibernate-jpa-aries'
dependencyFeatureNames = ['hibernate-base']
projects = [rootProject.childProjects.'hibernate-envers']
bundle {
match group: 'org.hibernate', module: 'hibernate-core'
include = false
}
bundle {
match group: 'org.hibernate', module: 'hibernate-osgi'
include = false
}
bundle {
match group: 'org.hibernate', module: 'hibernate-entitymanager'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-annotations'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-processor'
include = false
}
}
hibernateInfinispan {
name = 'hibernate-infinispan'
projects = [
rootProject.childProjects.'hibernate-infinispan',
project
]
description = 'Feature for easily adding Infinispan-based caching support to hibernate-native, hibernate-jpa or hibernate-jpa-aries'
dependencyFeatureNames = ['hibernate-base']
projects = [rootProject.childProjects.'hibernate-infinispan']
bundle {
match group: 'org.hibernate', module: 'hibernate-core'
include = false
}
bundle {
match group: 'org.hibernate', module: 'hibernate-osgi'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-annotations'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-processor'
include = false
}
bundle {
match group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
include = false
}
}
hibernateEhcache {
name = 'hibernate-ehcache'
projects = [
rootProject.childProjects.'hibernate-ehcache',
project
]
description = 'Feature for easily adding Ehcache-based caching support to hibernate-native, hibernate-jpa or hibernate-jpa-aries'
dependencyFeatureNames = ['hibernate-base']
projects = [rootProject.childProjects.'hibernate-ehcache']
bundle {
match group: 'org.hibernate', module: 'hibernate-core'
include = false
}
bundle {
match group: 'org.hibernate', module: 'hibernate-osgi'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-annotations'
include = false
}
bundle {
match group: 'org.jboss.logging', module: 'jboss-logging-processor'
include = false
}
}
}
}
Expand Down Expand Up @@ -234,3 +345,13 @@ tasks.test.dependsOn tasks.generateKarafFeatures
tasks.test.dependsOn tasks.jar
tasks.test.dependsOn tasks.generateDependsFile
tasks.test.dependsOn tasks.generatePaxExamEnvironmentFile

publishing {
publications {
mavenJava( MavenPublication ) {
artifact( project.extensions.karafFeatures.featuresXmlFile ) {
classifier 'karaf'
}
}
}
}

0 comments on commit ab66df1

Please sign in to comment.