|
1 |
| -/* |
2 |
| - * This file was generated by the Gradle 'init' task. |
3 |
| - */ |
4 |
| - |
5 | 1 | plugins {
|
6 |
| - id 'java-library' |
7 |
| - id 'maven-publish' |
| 2 | + id 'java' |
| 3 | + id 'org.springframework.boot' version '3.2.0-M2' |
| 4 | + id 'io.spring.dependency-management' version '1.1.3' |
| 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.30.RELEASE" |
8 | 8 | }
|
9 | 9 |
|
10 |
| -repositories { |
11 |
| - mavenLocal() |
12 |
| - maven { |
13 |
| - url = uri('https://repo.spring.io/snapshot') |
14 |
| - } |
| 10 | +publishing { |
| 11 | + publications { |
| 12 | + maven(MavenPublication) { |
| 13 | + from components.java |
| 14 | + versionMapping { |
| 15 | + usage('java-api') { |
| 16 | + fromResolutionOf('runtimeClasspath') |
| 17 | + } |
| 18 | + usage('java-runtime') { |
| 19 | + fromResolutionResult() |
| 20 | + } |
| 21 | + } |
| 22 | + } |
| 23 | + } |
| 24 | +} |
15 | 25 |
|
16 |
| - maven { |
17 |
| - url = uri('https://repo.spring.io/milestone') |
18 |
| - } |
| 26 | +thinPom.mustRunAfter resolveMainClassName, test |
19 | 27 |
|
20 |
| - maven { |
21 |
| - url = uri('https://repo.maven.apache.org/maven2/') |
22 |
| - } |
| 28 | +group = 'com.example' |
| 29 | +version = '0.0.1-SNAPSHOT' |
| 30 | + |
| 31 | +java { |
| 32 | + sourceCompatibility = '17' |
23 | 33 | }
|
24 | 34 |
|
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' |
| 35 | +repositories { |
| 36 | + mavenCentral() |
| 37 | + maven { url 'https://repo.spring.io/milestone' } |
| 38 | +} |
| 39 | + |
| 40 | +ext { |
| 41 | + set('springCloudVersion', "2023.0.0-M1") |
31 | 42 | }
|
32 | 43 |
|
33 |
| -group = 'io.spring.sample' |
34 |
| -version = '4.0.0.RELEASE' |
35 |
| -description = 'function-sample-aws' |
36 |
| -java.sourceCompatibility = JavaVersion.VERSION_1_8 |
| 44 | +assemble.dependsOn = [shadowJar, thinJar] |
37 | 45 |
|
38 |
| -publishing { |
39 |
| - publications { |
40 |
| - maven(MavenPublication) { |
41 |
| - from(components.java) |
42 |
| - } |
43 |
| - } |
| 46 | + |
| 47 | +import com.github.jengelman.gradle.plugins.shadow.transformers.* |
| 48 | + |
| 49 | +shadowJar { |
| 50 | + archiveClassifier = 'aws' |
| 51 | + dependencies { |
| 52 | + exclude( |
| 53 | + dependency("org.springframework.cloud:spring-cloud-function-web:4.1.0-SNAPSHOT")) |
| 54 | + } |
| 55 | + // Required for Spring |
| 56 | + mergeServiceFiles() |
| 57 | + append 'META-INF/spring.handlers' |
| 58 | + append 'META-INF/spring.schemas' |
| 59 | + append 'META-INF/spring.tooling' |
| 60 | + append 'META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports' |
| 61 | + append 'META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports' |
| 62 | + transform(PropertiesFileTransformer) { |
| 63 | + paths = ['META-INF/spring.factories'] |
| 64 | + mergeStrategy = "append" |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | + |
| 69 | +dependencies { |
| 70 | + implementation 'org.springframework.boot:spring-boot-starter' |
| 71 | + implementation 'org.springframework.cloud:spring-cloud-function-context' |
| 72 | + testImplementation 'org.springframework.boot:spring-boot-starter-test' |
44 | 73 | }
|
45 | 74 |
|
46 |
| -tasks.withType(JavaCompile) { |
47 |
| - options.encoding = 'UTF-8' |
| 75 | +dependencyManagement { |
| 76 | + imports { |
| 77 | + mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" |
| 78 | + } |
48 | 79 | }
|
49 | 80 |
|
50 |
| -tasks.withType(Javadoc) { |
51 |
| - options.encoding = 'UTF-8' |
| 81 | +tasks.named('test') { |
| 82 | + useJUnitPlatform() |
52 | 83 | }
|
0 commit comments