11plugins {
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"
98}
109
1110group = ' com.example'
1211version = ' 0.0.1-SNAPSHOT'
1312
14- // java {
15- // sourceCompatibility = '17'
16- // }
13+ java {
14+ sourceCompatibility = ' 17'
15+ }
1716
1817repositories {
1918 mavenCentral()
@@ -22,53 +21,53 @@ repositories {
2221}
2322
2423ext {
25- set(' springCloudVersion' , " 2024.0.1-SNAPSHOT " )
24+ set(' springCloudVersion' , " 2024.0.1" )
2625}
2726
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]
4528
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+ }
4744
45+ shadowJar. mustRunAfter thinJar
4846
49- // import com.github.jengelman.gradle.plugins.shadow.transformers.*
47+ import com.github.jengelman.gradle.plugins.shadow.transformers.*
5048
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+ }
6866
6967dependencies {
7068 implementation ' org.springframework.boot:spring-boot-starter'
7169 implementation ' org.springframework.cloud:spring-cloud-function-adapter-aws'
70+ implementation ' org.springframework.cloud:spring-cloud-function-context'
7271 testImplementation ' org.springframework.boot:spring-boot-starter-test'
7372}
7473
0 commit comments