Skip to content

Instantly share code, notes, and snippets.

@kolorobot
Created September 3, 2015 22:05
Show Gist options
  • Save kolorobot/b5db05f6a5930642e6e3 to your computer and use it in GitHub Desktop.
Save kolorobot/b5db05f6a5930642e6e3 to your computer and use it in GitHub Desktop.
Spring Boot with overridden Spring Version (without dependency management)
buildscript {
ext {
springBootVersion = '1.2.5.RELEASE'
springVersion = '4.2.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
jar {
baseName = 'demo'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.springframework') {
details.useVersion "${springVersion}"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.6'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment