Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 85bf404

Browse files
committed
build: remove module dependency on hibernate-ehcache
Moved `hibernate-ehcache` to a runtime dependency where needed for tests, making it optional and reducing unnecessary module coupling. As a result, applications using `hibernate-ehcache` will now need to explicitly add it as a dependency.
1 parent 89ccb91 commit 85bf404

File tree

4 files changed

+7
-30
lines changed

4 files changed

+7
-30
lines changed

examples/grails-hibernate/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies {
2626
runtimeOnly 'org.grails:grails-plugin-services'
2727
runtimeOnly 'org.grails:grails-plugin-url-mappings'
2828
runtimeOnly 'org.grails.plugins:fields'
29+
runtimeOnly "org.hibernate:hibernate-ehcache:$hibernateVersion"
2930
runtimeOnly 'org.springframework.boot:spring-boot-autoconfigure'
3031
runtimeOnly 'org.springframework.boot:spring-boot-starter-logging'
3132
runtimeOnly 'org.springframework.boot:spring-boot-starter-tomcat'

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ grailsGradlePluginVersion=7.0.0-M2
66
grailsVersion=7.0.0-M1
77
groovyVersion=4.0.24
88
hibernateVersion=5.6.15.Final
9-
jbossTransactionApiVersion=2.0.0.Final
109
yakworksHibernateGroovyProxyVersion=1.1
1110
micronautPlatformVersion=4.6.3
1211
picocliVersion=4.7.6

grails-datastore-gorm-hibernate/build.gradle

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@ dependencies {
2121
exclude group:'org.slf4j', module:'slf4j-api'
2222
}
2323

24-
compileOnly "org.hibernate:hibernate-ehcache:$hibernateVersion", {
25-
exclude group:'commons-collections', module:'commons-collections'
26-
exclude group:'commons-logging', module:'commons-logging'
27-
exclude group:'com.h2database', module:'h2'
28-
exclude group:'net.sf.ehcache', module:'ehcache'
29-
exclude group:'net.sf.ehcache', module:'ehcache-core'
30-
exclude group:'org.hibernate', module:'hibernate-core'
31-
exclude group:'org.slf4j', module:'jcl-over-slf4j'
32-
exclude group:'org.slf4j', module:'slf4j-api'
33-
exclude group:'org.slf4j', module:'slf4j-log4j12'
34-
exclude group:'xml-apis', module:'xml-apis'
35-
}
36-
3724
testImplementation "org.apache.groovy:groovy-test-junit5"
3825
testImplementation "org.apache.groovy:groovy-sql"
3926
testImplementation "org.apache.groovy:groovy-json"
@@ -42,22 +29,17 @@ dependencies {
4229
}
4330
testImplementation "com.h2database:h2"
4431

45-
testImplementation "org.hibernate:hibernate-ehcache:$hibernateVersion", {
46-
exclude group:'org.hibernate', module:'hibernate-core'
47-
}
48-
4932
// groovy proxy fixes bytebuddy to be a bit smarter when it comes to groovy metaClass
5033
testImplementation "org.yakworks:hibernate-groovy-proxy:$yakworksHibernateGroovyProxyVersion", {
5134
exclude group: "org.codehaus.groovy", module: "groovy"
5235
}
5336

5437
testImplementation "org.apache.tomcat:tomcat-jdbc"
55-
testRuntimeOnly "org.springframework:spring-aop"
5638

39+
testRuntimeOnly "org.hibernate:hibernate-ehcache:$hibernateVersion"
5740
testRuntimeOnly "org.slf4j:slf4j-simple"
5841
testRuntimeOnly "org.slf4j:jcl-over-slf4j"
59-
// The groovydoc task needs the Hibernate 4.x jars in the classpath
60-
documentation "org.hibernate:hibernate-core-jakarta:${hibernateVersion}"
42+
testRuntimeOnly "org.springframework:spring-aop"
6143
}
6244

6345
test {

grails-plugin/build.gradle

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ dependencies {
2525
api "org.springframework.boot:spring-boot"
2626
api "org.springframework:spring-orm"
2727
api "org.hibernate:hibernate-core-jakarta:$hibernateVersion"
28-
api "org.hibernate:hibernate-ehcache:$hibernateVersion", {
29-
exclude group:'org.hibernate', module:'hibernate-core'
30-
}
31-
// required for org.hibernate:hibernate-ehcache to work with org.hibernate:hibernate-core-jakarta
32-
api "org.jboss.spec.javax.transaction:jboss-transaction-api_1.3_spec:$jbossTransactionApiVersion", {
33-
exclude group:"jakarta.enterprise", module:"jakarta.enterprise.cdi-api"
34-
}
35-
3628
api "org.grails:grails-datastore-web"
3729
api "org.grails:grails-datastore-gorm-support"
3830
api project(":grails-datastore-gorm-hibernate5"), {
@@ -45,12 +37,15 @@ dependencies {
4537
exclude group:'org.grails', module:'grails-core'
4638
exclude group:'javax.transaction', module:'jta'
4739
}
48-
testRuntimeOnly "org.yaml:snakeyaml"
40+
4941
testImplementation "org.grails:grails-gorm-testing-support"
42+
5043
testRuntimeOnly "com.h2database:h2"
5144
testRuntimeOnly "org.apache.tomcat:tomcat-jdbc"
45+
testRuntimeOnly "org.hibernate:hibernate-ehcache:$hibernateVersion"
5246
testRuntimeOnly "org.springframework:spring-aop"
5347
testRuntimeOnly "org.springframework:spring-expression"
48+
testRuntimeOnly "org.yaml:snakeyaml"
5449
}
5550

5651
groovydoc.classpath += configurations.documentation

0 commit comments

Comments
 (0)