Skip to content

Commit 3f8b7f1

Browse files
committed
GH-1037 Fix gradle build
Resolves #1037
1 parent 57b8631 commit 3f8b7f1

File tree

6 files changed

+262
-227
lines changed

6 files changed

+262
-227
lines changed
Lines changed: 38 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,52 @@
1-
buildscript {
2-
ext {
3-
springBootVersion = '2.6.7'
4-
wrapperVersion = '1.0.29.BUILD-SNAPSHOT'
5-
shadowVersion = '5.1.0'
6-
}
7-
repositories {
8-
mavenLocal()
9-
jcenter()
10-
mavenCentral()
11-
maven { url "https://repo.spring.io/snapshot" }
12-
maven { url "https://repo.spring.io/milestone" }
13-
}
14-
dependencies {
15-
classpath "com.github.jengelman.gradle.plugins:shadow:${shadowVersion}"
16-
classpath("org.springframework.boot.experimental:spring-boot-thin-gradle-plugin:${wrapperVersion}")
17-
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
18-
classpath("io.spring.gradle:dependency-management-plugin:1.0.8.RELEASE")
19-
}
20-
}
21-
22-
apply plugin: 'java'
23-
apply plugin: 'maven-publish'
24-
apply plugin: 'eclipse'
25-
apply plugin: 'com.github.johnrengelman.shadow'
26-
apply plugin: 'org.springframework.boot'
27-
apply plugin: 'org.springframework.boot.experimental.thin-launcher'
28-
apply plugin: 'io.spring.dependency-management'
29-
30-
group = 'io.spring.sample'
31-
version = '2.0.0.RELEASE'
32-
sourceCompatibility = 1.8
33-
targetCompatibility = 1.8
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*/
344

35-
repositories {
36-
mavenLocal()
37-
mavenCentral()
38-
maven { url "https://repo.spring.io/snapshot" }
39-
maven { url "https://repo.spring.io/milestone" }
5+
plugins {
6+
id 'java-library'
7+
id 'maven-publish'
408
}
419

42-
ext {
43-
springCloudFunctionVersion = "3.2.4"
44-
awsLambdaEventsVersion = "3.9.0"
45-
awsLambdaCoreVersion = "1.1.0"
46-
}
47-
ext['reactor.version'] = "3.1.7.RELEASE"
10+
repositories {
11+
mavenLocal()
12+
maven {
13+
url = uri('https://repo.spring.io/snapshot')
14+
}
4815

49-
assemble.dependsOn = [shadowJar, thinJar]
16+
maven {
17+
url = uri('https://repo.spring.io/milestone')
18+
}
5019

51-
jar {
52-
manifest {
53-
attributes 'Main-Class': 'example.FunctionConfiguration'
54-
}
20+
maven {
21+
url = uri('https://repo.maven.apache.org/maven2/')
22+
}
5523
}
5624

57-
import com.github.jengelman.gradle.plugins.shadow.transformers.*
58-
59-
shadowJar {
60-
classifier = 'aws'
61-
dependencies {
62-
exclude(
63-
dependency("org.springframework.cloud:spring-cloud-function-web:${springCloudFunctionVersion}"))
64-
}
65-
// Required for Spring
66-
mergeServiceFiles()
67-
append 'META-INF/spring.handlers'
68-
append 'META-INF/spring.schemas'
69-
append 'META-INF/spring.tooling'
70-
transform(PropertiesFileTransformer) {
71-
paths = ['META-INF/spring.factories']
72-
mergeStrategy = "append"
73-
}
25+
dependencies {
26+
api 'org.springframework.cloud:spring-cloud-function-adapter-aws:4.0.3-SNAPSHOT'
27+
api 'com.amazonaws:aws-lambda-java-events:3.9.0'
28+
api 'org.springframework.boot:spring-boot-configuration-processor:3.0.5'
29+
testImplementation 'org.springframework.boot:spring-boot-starter-test:3.0.5'
30+
compileOnly 'com.amazonaws:aws-lambda-java-core:1.1.0'
7431
}
7532

76-
configurations {
77-
testCompile.extendsFrom(compileOnly)
33+
group = 'io.spring.sample'
34+
version = '4.0.0.RELEASE'
35+
description = 'function-sample-aws'
36+
java.sourceCompatibility = JavaVersion.VERSION_1_8
37+
38+
publishing {
39+
publications {
40+
maven(MavenPublication) {
41+
from(components.java)
42+
}
43+
}
7844
}
7945

80-
dependencyManagement {
81-
imports {
82-
mavenBom "org.springframework.cloud:spring-cloud-function-dependencies:${springCloudFunctionVersion}"
83-
}
46+
tasks.withType(JavaCompile) {
47+
options.encoding = 'UTF-8'
8448
}
8549

86-
dependencies {
87-
implementation("org.springframework.cloud:spring-cloud-function-adapter-aws")
88-
implementation("org.springframework.cloud:spring-cloud-starter-function-webflux")
89-
implementation("org.springframework.boot:spring-boot-configuration-processor")
90-
compileOnly("com.amazonaws:aws-lambda-java-events:${awsLambdaEventsVersion}")
91-
compileOnly("com.amazonaws:aws-lambda-java-core:${awsLambdaCoreVersion}")
92-
testCompile('org.springframework.boot:spring-boot-starter-test')
50+
tasks.withType(Javadoc) {
51+
options.encoding = 'UTF-8'
9352
}
Binary file not shown.

spring-cloud-function-samples/function-sample-aws/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
35
zipStoreBase=GRADLE_USER_HOME
46
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip

0 commit comments

Comments
 (0)