Use Spring dependency management plugin
This commit introduces the Spring dependency management Gradle plugin. All dependency versions and BOMs are now managed in the root project and declared in the modules directly.
This commit is contained in:
committed by
Rossen Stoyanchev
parent
e944eec255
commit
2f2c2e0313
121
build.gradle
121
build.gradle
@@ -9,14 +9,84 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
plugins {
|
||||
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
|
||||
}
|
||||
|
||||
ext {
|
||||
moduleProjects = subprojects.findAll { it.name.startsWith("spring-") }
|
||||
javaProjects = subprojects - project("spring-js-resources")
|
||||
withoutJclOverSlf4j = {
|
||||
exclude group: "org.slf4j", name: "jcl-over-slf4j"
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
group = "org.springframework.webflow"
|
||||
|
||||
apply plugin: "io.spring.dependency-management"
|
||||
apply plugin: "propdeps"
|
||||
apply plugin: "java"
|
||||
apply from: "${rootProject.projectDir}/ide.gradle"
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "org.springframework:spring-framework-bom:5.2.6.RELEASE"
|
||||
mavenBom "org.springframework.security:spring-security-bom:5.3.1.RELEASE"
|
||||
mavenBom "org.junit:junit-bom:5.6.2"
|
||||
}
|
||||
dependencies {
|
||||
dependency "javax.servlet:javax.servlet-api:3.1.0"
|
||||
dependency "javax.servlet:jstl:1.2"
|
||||
dependency "javax.servlet.jsp:javax.servlet.jsp-api:2.3.2-b02"
|
||||
dependency "javax.el:javax.el-api:3.0.1-b06"
|
||||
dependency "javax.validation:validation-api:2.0.1.Final"
|
||||
dependencySet(group: 'org.hibernate', version: '5.4.14.Final') {
|
||||
entry 'hibernate-core'
|
||||
entry 'hibernate-entitymanager'
|
||||
}
|
||||
dependency "org.hibernate:hibernate-validator:6.1.4.Final"
|
||||
dependencySet(group: 'com.sun.faces', version: '2.2.16') {
|
||||
entry 'jsf-api'
|
||||
entry 'jsf-impl'
|
||||
}
|
||||
dependencySet(group: 'org.apache.tiles', version: '3.0.8') {
|
||||
entry 'tiles-api'
|
||||
entry('tiles-core', withoutJclOverSlf4j)
|
||||
entry('tiles-servlet', withoutJclOverSlf4j)
|
||||
entry('tiles-jsp', withoutJclOverSlf4j)
|
||||
entry('tiles-el', withoutJclOverSlf4j)
|
||||
entry('tiles-extras') {
|
||||
exclude group: "org.springframework", name: "spring-web"
|
||||
}
|
||||
}
|
||||
dependency "org.apache.myfaces.core:myfaces-impl:2.2.12"
|
||||
dependency "com.sun.facelets:jsf-facelets:1.1.14"
|
||||
dependency "org.hsqldb:hsqldb:2.5.0"
|
||||
|
||||
dependencySet(group: 'org.apache.logging.log4j', version: '2.13.2') {
|
||||
entry 'log4j-api'
|
||||
entry 'log4j-core'
|
||||
entry 'log4j-slf4j-impl'
|
||||
entry 'log4j-jul'
|
||||
}
|
||||
dependency "org.slf4j:slf4j-api:1.7.30"
|
||||
|
||||
dependency("junit:junit:4.13") {
|
||||
exclude group: "org.hamcrest", name: "hamcrest-core"
|
||||
}
|
||||
dependency "org.easymock:easymock:4.2"
|
||||
dependency "org.hamcrest:hamcrest:2.1"
|
||||
dependency "org.apache.tomcat:tomcat-jasper-el:9.0.34"
|
||||
dependency "org.apache.myfaces.test:myfaces-test22:1.0.8"
|
||||
}
|
||||
generatedPomCustomization {
|
||||
enabled = false
|
||||
}
|
||||
resolutionStrategy {
|
||||
cacheChangingModulesFor 0, "seconds"
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
if (!version.endsWith('RELEASE')) {
|
||||
@@ -26,6 +96,13 @@ allprojects {
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
}
|
||||
}
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
cacheChangingModulesFor 0, "seconds"
|
||||
cacheDynamicVersionsFor 0, "seconds"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
subprojects { subproject ->
|
||||
@@ -52,47 +129,7 @@ subprojects { subproject ->
|
||||
}
|
||||
}
|
||||
|
||||
configure(subprojects.findAll {
|
||||
it.name != "spring-build-src" && it.name != "spring-js-resources"}) { subproject ->
|
||||
|
||||
subproject.ext {
|
||||
springVersion = "5.2.6.RELEASE"
|
||||
springSecurityVersion = "5.3.1.RELEASE"
|
||||
servletVersion = "3.1.0"
|
||||
hibernate5Version = "5.4.14.Final"
|
||||
tiles3Version = "3.0.8"
|
||||
log4jVersion = "2.13.2"
|
||||
junit5Version = "5.6.2"
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
// Check for updates every build
|
||||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
||||
|
||||
// Consistent slf4j version (e.g. clashes between slf4j versions)
|
||||
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
|
||||
if (details.requested.group == 'org.slf4j') {
|
||||
details.useVersion "1.7.25"
|
||||
}
|
||||
}
|
||||
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile("org.springframework:spring-beans:$springVersion")
|
||||
compile("org.springframework:spring-context:$springVersion")
|
||||
compile("org.springframework:spring-core:$springVersion")
|
||||
compile("org.springframework:spring-expression:$springVersion")
|
||||
compileOnly("javax.el:javax.el-api:3.0.1-b06")
|
||||
testCompile("org.junit.jupiter:junit-jupiter:${junit5Version}")
|
||||
testCompile("org.hamcrest:hamcrest-all:1.3")
|
||||
testCompile("org.easymock:easymock:4.2")
|
||||
testCompile("org.apache.tomcat:tomcat-jasper-el:9.0.34")
|
||||
testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
|
||||
testRuntime("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}")
|
||||
testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
|
||||
}
|
||||
configure(javaProjects) { javaProject ->
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
|
||||
Reference in New Issue
Block a user