See also gh-109. So there is a TODO in there to fix the configuration and when the thin launcher 1.0.7 comes out we should update the version as well. But it's working now, and quite similar to the Maven output, except for the thin.properties. Fixes gh-108
76 lines
2.0 KiB
Groovy
76 lines
2.0 KiB
Groovy
buildscript {
|
|
ext {
|
|
springBootVersion = '1.5.2.RELEASE'
|
|
wrapperVersion = '1.0.7.BUILD-SNAPSHOT'
|
|
shadowVersion = '2.0.1'
|
|
}
|
|
repositories {
|
|
jcenter()
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven { url "https://repo.spring.io/snapshot" }
|
|
maven { url "https://repo.spring.io/milestone" }
|
|
}
|
|
dependencies {
|
|
classpath "com.github.jengelman.gradle.plugins:shadow:${shadowVersion}"
|
|
classpath("org.springframework.boot.experimental:spring-boot-thin-gradle-plugin:${wrapperVersion}")
|
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
|
}
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'maven'
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
apply plugin: 'spring-boot'
|
|
apply plugin: 'org.springframework.boot.experimental.thin-launcher'
|
|
|
|
group = 'com.example'
|
|
version = '0.0.1-SNAPSHOT'
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven { url "https://repo.spring.io/snapshot" }
|
|
maven { url "https://repo.spring.io/milestone" }
|
|
}
|
|
|
|
ext {
|
|
springCloudFunctionVersion = "1.0.0.BUILD-SNAPSHOT"
|
|
awsLambdaEventsVersion = "1.2.1"
|
|
awsLambdaCoreVersion = "1.1.0"
|
|
}
|
|
ext['reactor.version'] = "3.0.7.RELEASE"
|
|
|
|
assemble.dependsOn = [shadowJar, bootRepackage]
|
|
|
|
jar {
|
|
manifest {
|
|
attributes 'Start-Class': 'example.Config'
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
classifier = 'aws'
|
|
dependencies {
|
|
exclude(dependency("org.springframework.cloud:spring-cloud-function-web:${springCloudFunctionVersion}"))
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
testCompile.extendsFrom(compileOnly)
|
|
}
|
|
|
|
// TODO: remove this when pom.xml generator is fixed
|
|
jar.dependsOn = [thinProperties]
|
|
|
|
dependencies {
|
|
compile("org.springframework.cloud:spring-cloud-function-web:${springCloudFunctionVersion}")
|
|
compile("org.springframework.cloud:spring-cloud-function-adapter-aws:${springCloudFunctionVersion}")
|
|
compileOnly("com.amazonaws:aws-lambda-java-events:${awsLambdaEventsVersion}")
|
|
compileOnly("com.amazonaws:aws-lambda-java-core:${awsLambdaCoreVersion}")
|
|
testCompile('org.springframework.boot:spring-boot-starter-test')
|
|
}
|