1
1
plugins {
2
- id ' org.springframework.cloud.function.aws-lambda.packaging' version ' 1.0.0'
3
- // id 'java'
4
- id ' org.springframework.boot' version ' 3.4.0'
5
- // id 'io.spring.dependency-management' version '1.1.3'
6
- // id 'com.github.johnrengelman.shadow' version '8.1.1'
7
- // id 'maven-publish'
8
- // id 'org.springframework.boot.experimental.thin-launcher' version "1.0.31.RELEASE"
2
+ id ' java'
3
+ id ' org.springframework.boot' version ' 3.4.4'
4
+ id ' io.spring.dependency-management' version ' 1.1.7'
5
+ id ' com.github.johnrengelman.shadow' version ' 8.1.1'
6
+ id ' maven-publish'
7
+ id ' org.springframework.boot.experimental.thin-launcher' version " 1.0.31.RELEASE"
9
8
}
10
9
11
10
group = ' com.example'
12
11
version = ' 0.0.1-SNAPSHOT'
13
12
14
- // java {
15
- // sourceCompatibility = '17'
16
- // }
13
+ java {
14
+ sourceCompatibility = ' 17'
15
+ }
17
16
18
17
repositories {
19
18
mavenCentral()
@@ -22,53 +21,53 @@ repositories {
22
21
}
23
22
24
23
ext {
25
- set(' springCloudVersion' , " 2024.0.1-SNAPSHOT " )
24
+ set(' springCloudVersion' , " 2024.0.1" )
26
25
}
27
26
28
- // assemble.dependsOn = [thinJar, shadowJar]
29
-
30
- // publishing {
31
- // publications {
32
- // maven(MavenPublication) {
33
- // from components.java
34
- // versionMapping {
35
- // usage('java-api') {
36
- // fromResolutionOf('runtimeClasspath')
37
- // }
38
- // usage('java-runtime') {
39
- // fromResolutionResult()
40
- // }
41
- // }
42
- // }
43
- // }
44
- // }
27
+ assemble. dependsOn = [thinJar, shadowJar]
45
28
46
- // shadowJar.mustRunAfter thinJar
29
+ publishing {
30
+ publications {
31
+ maven(MavenPublication ) {
32
+ from components. java
33
+ versionMapping {
34
+ usage(' java-api' ) {
35
+ fromResolutionOf(' runtimeClasspath' )
36
+ }
37
+ usage(' java-runtime' ) {
38
+ fromResolutionResult()
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
47
44
45
+ shadowJar. mustRunAfter thinJar
48
46
49
- // import com.github.jengelman.gradle.plugins.shadow.transformers.*
47
+ import com.github.jengelman.gradle.plugins.shadow.transformers.*
50
48
51
- // shadowJar {
52
- // archiveClassifier = 'aws'
53
- // manifest {
54
- // inheritFrom(project.tasks.thinJar.manifest)
55
- // }
56
- // Required for Spring
57
- // mergeServiceFiles()
58
- // append 'META-INF/spring.handlers'
59
- // append 'META-INF/spring.schemas'
60
- // append 'META-INF/spring.tooling'
61
- // append 'META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports'
62
- // append 'META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports'
63
- // transform(PropertiesFileTransformer) {
64
- // paths = ['META-INF/spring.factories']
65
- // mergeStrategy = "append"
66
- // }
67
- // }
49
+ shadowJar {
50
+ archiveClassifier = ' aws'
51
+ manifest {
52
+ inheritFrom(project. tasks. thinJar. manifest)
53
+ }
54
+ // Required for Spring
55
+ mergeServiceFiles()
56
+ append ' META-INF/spring.handlers'
57
+ append ' META-INF/spring.schemas'
58
+ append ' META-INF/spring.tooling'
59
+ append ' META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports'
60
+ append ' META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports'
61
+ transform(PropertiesFileTransformer ) {
62
+ paths = [' META-INF/spring.factories' ]
63
+ mergeStrategy = " append"
64
+ }
65
+ }
68
66
69
67
dependencies {
70
68
implementation ' org.springframework.boot:spring-boot-starter'
71
69
implementation ' org.springframework.cloud:spring-cloud-function-adapter-aws'
70
+ implementation ' org.springframework.cloud:spring-cloud-function-context'
72
71
testImplementation ' org.springframework.boot:spring-boot-starter-test'
73
72
}
74
73
0 commit comments