diff --git a/build.gradle b/build.gradle index 7aecf1b89727..417121df925b 100644 --- a/build.gradle +++ b/build.gradle @@ -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' } } diff --git a/hibernate-osgi/hibernate-osgi.gradle b/hibernate-osgi/hibernate-osgi.gradle index 783ef315cc97..14d9533fa11b 100644 --- a/hibernate-osgi/hibernate-osgi.gradle +++ b/hibernate-osgi/hibernate-osgi.gradle @@ -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 { @@ -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' } @@ -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 + } } } } @@ -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' + } + } + } +} \ No newline at end of file