build.gradle - AWS Code Sample

build.gradle

plugins { id 'java' } repositories { mavenCentral() } dependencies { implementation platform('software.amazon.awssdk:bom:2.10.73') implementation platform('com.amazonaws:aws-xray-recorder-sdk-bom:2.4.0') implementation 'software.amazon.awssdk:lambda' implementation 'com.amazonaws:aws-xray-recorder-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-core' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2' implementation 'com.amazonaws:aws-xray-recorder-sdk-aws-sdk-v2-instrumentor' implementation 'com.amazonaws:aws-lambda-java-core:1.2.0' implementation 'com.amazonaws:aws-lambda-java-events:2.2.7' implementation 'com.google.code.gson:gson:2.8.6' implementation 'org.apache.logging.log4j:log4j-api:2.13.0' implementation 'org.apache.logging.log4j:log4j-core:2.13.0' runtimeOnly 'org.apache.logging.log4j:log4j-slf4j18-impl:2.13.0' runtimeOnly 'com.amazonaws:aws-lambda-java-log4j2:1.1.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0' } test { useJUnitPlatform() } task packageFat(type: Zip) { from compileJava from processResources into('lib') { from configurations.runtimeClasspath } dirMode = 0755 fileMode = 0755 } task packageLibs(type: Zip) { into('java/lib') { from configurations.runtimeClasspath } dirMode = 0755 fileMode = 0755 } task packageSkinny(type: Zip) { from compileJava from processResources } java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } build.dependsOn packageSkinny