From 469e93ec2d1b7372d9a470a1c967fea0790bb6c7 Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Tue, 28 Nov 2023 16:11:53 +0000 Subject: [PATCH 01/10] Remove Java 8 issue #1466 --- examples/README.md | 2 -- examples/powertools-examples-batch/pom.xml | 25 ++----------------- .../README.md | 11 +++++++- .../pom.xml | 24 ++---------------- .../cdk/app/pom.xml | 24 ++---------------- .../cdk/infra/pom.xml | 4 +-- .../gradle/README.md | 2 +- .../gradle/build.gradle | 4 +-- .../gradle/template.yaml | 4 +-- .../kotlin/README.md | 2 +- .../kotlin/build.gradle.kts | 19 +++----------- .../sam/pom.xml | 24 ++---------------- .../serverless/pom.xml | 25 +++---------------- .../terraform/pom.xml | 24 ++---------------- .../powertools-examples-idempotency/pom.xml | 24 ++---------------- .../powertools-examples-parameters/pom.xml | 24 ++---------------- .../powertools-examples-serialization/pom.xml | 12 ++------- .../powertools-examples-validation/README.md | 2 +- pom.xml | 4 +-- 19 files changed, 43 insertions(+), 217 deletions(-) diff --git a/examples/README.md b/examples/README.md index aa8457def..2e34513db 100644 --- a/examples/README.md +++ b/examples/README.md @@ -63,8 +63,6 @@ If you're not using SAM, you can look for examples for other tools under [powert You can find more examples in the https://github.com/aws/aws-sam-cli-app-templates project: -* [Java 8 + Maven](https://github.com/aws/aws-sam-cli-app-templates/tree/master/java8/hello-pt-maven) -* [Java 8 on Amazon Linux 2 + Maven](https://github.com/aws/aws-sam-cli-app-templates/tree/master/java8.al2/hello-pt-maven) * [Java 11 + Maven](https://github.com/aws/aws-sam-cli-app-templates/tree/master/java11/hello-pt-maven) * [Java 17 + Maven](https://github.com/aws/aws-sam-cli-app-templates/tree/master/java17/hello-pt-maven) * [Java 17 + Gradle](https://github.com/aws/aws-sam-cli-app-templates/tree/master/java17/hello-pt-gradle) diff --git a/examples/powertools-examples-batch/pom.xml b/examples/powertools-examples-batch/pom.xml index a5115aeeb..36660bc96 100644 --- a/examples/powertools-examples-batch/pom.xml +++ b/examples/powertools-examples-batch/pom.xml @@ -12,8 +12,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.9.20 2.21.1 @@ -143,25 +143,4 @@ - - - - - jdk8 - - (,11) - - - 1.9.7 - - - \ No newline at end of file diff --git a/examples/powertools-examples-cloudformation/README.md b/examples/powertools-examples-cloudformation/README.md index 4b53ff0aa..f0a15f1cd 100644 --- a/examples/powertools-examples-cloudformation/README.md +++ b/examples/powertools-examples-cloudformation/README.md @@ -2,18 +2,27 @@ This project contains an example of Lambda function using the CloudFormation module of Powertools for AWS Lambda in Java. For more information on this module, please refer to the [documentation](https://awslabs.github.io/aws-lambda-powertools-java/utilities/custom_resources/). +In this example you pass in a bucket name as a parameter and upon CloudFormation events a call is made to a lambda. That lambda attempts to create the bucket on CREATE events, create a new bucket if the name changes with an UPDATE event and delete the bucket upon DELETE events. + ## Deploy the sample application This sample can be used either with the Serverless Application Model (SAM) or with CDK. ### Deploy with SAM CLI To deploy it using the SAM CLI, check out the instructions for getting started in [the examples directory](../README.md) +Run the following in your shell: + +```bash +cd infra/sam +sam build +sam deploy --guided --parameter-overrides BucketNameParam=my-unique-bucket-20230718 +``` ### Deploy with CDK To use CDK you need the following tools. * CDK - [Install CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) -* Java 8 - [Install Java 8](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html) +* Java 11 - [Install Java 11](https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html) * Maven - [Install Maven](https://maven.apache.org/install.html) * Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community) diff --git a/examples/powertools-examples-cloudformation/pom.xml b/examples/powertools-examples-cloudformation/pom.xml index d179fbe2e..864ea5fe6 100644 --- a/examples/powertools-examples-cloudformation/pom.xml +++ b/examples/powertools-examples-cloudformation/pom.xml @@ -11,8 +11,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.2.3 3.11.3 2.21.0 @@ -169,24 +169,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-core-utilities/cdk/app/pom.xml b/examples/powertools-examples-core-utilities/cdk/app/pom.xml index be8c9ca67..822e87633 100644 --- a/examples/powertools-examples-core-utilities/cdk/app/pom.xml +++ b/examples/powertools-examples-core-utilities/cdk/app/pom.xml @@ -12,8 +12,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.9.20 @@ -138,24 +138,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-core-utilities/cdk/infra/pom.xml b/examples/powertools-examples-core-utilities/cdk/infra/pom.xml index d2b05b122..053bd239c 100644 --- a/examples/powertools-examples-core-utilities/cdk/infra/pom.xml +++ b/examples/powertools-examples-core-utilities/cdk/infra/pom.xml @@ -18,8 +18,8 @@ maven-compiler-plugin 3.11.0 - 1.8 - 1.8 + 11 + 11 diff --git a/examples/powertools-examples-core-utilities/gradle/README.md b/examples/powertools-examples-core-utilities/gradle/README.md index c7c798d5d..adc7fe635 100644 --- a/examples/powertools-examples-core-utilities/gradle/README.md +++ b/examples/powertools-examples-core-utilities/gradle/README.md @@ -1,7 +1,7 @@ # Powertools for AWS Lambda (Java) - Core Utilities Example with Gradle This project demonstrates the Lambda for Powertools Java module deployed using [Serverless Application Model](https://aws.amazon.com/serverless/sam/) with -[Gradle](https://gradle.org/) running the build. This example is configured for Java 1.8 only; in order to use a newer version, check out the Gradle +[Gradle](https://gradle.org/) running the build. This example is configured for Java 11 only; in order to use a newer version, check out the Gradle configuration guide [in the main project README](../../../README.md). You can also use `sam init` to create a new Gradle-powered Powertools application - choose to use the **AWS Quick Start Templates**, diff --git a/examples/powertools-examples-core-utilities/gradle/build.gradle b/examples/powertools-examples-core-utilities/gradle/build.gradle index e85936350..93452cc81 100644 --- a/examples/powertools-examples-core-utilities/gradle/build.gradle +++ b/examples/powertools-examples-core-utilities/gradle/build.gradle @@ -9,8 +9,8 @@ wrapper { } compileJava { - sourceCompatibility = "1.8" - targetCompatibility = "1.8" + sourceCompatibility = "11" + targetCompatibility = "11" ajc { enabled = true diff --git a/examples/powertools-examples-core-utilities/gradle/template.yaml b/examples/powertools-examples-core-utilities/gradle/template.yaml index a717c2998..1a1572fca 100644 --- a/examples/powertools-examples-core-utilities/gradle/template.yaml +++ b/examples/powertools-examples-core-utilities/gradle/template.yaml @@ -26,7 +26,7 @@ Resources: Properties: CodeUri: . Handler: helloworld.App::handleRequest - Runtime: java8 + Runtime: java11 MemorySize: 512 Environment: # More info about Env Vars: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#environment-object Variables: @@ -43,7 +43,7 @@ Resources: Properties: CodeUri: . Handler: helloworld.AppStream::handleRequest - Runtime: java8 + Runtime: java11 MemorySize: 512 Tracing: Active Environment: diff --git a/examples/powertools-examples-core-utilities/kotlin/README.md b/examples/powertools-examples-core-utilities/kotlin/README.md index da9ec5b52..422e12742 100644 --- a/examples/powertools-examples-core-utilities/kotlin/README.md +++ b/examples/powertools-examples-core-utilities/kotlin/README.md @@ -1,7 +1,7 @@ # Powertools for AWS Lambda (Kotlin) - Core Utilities Example This project demonstrates the Lambda for Powertools Kotlin module deployed using [Serverless Application Model](https://aws.amazon.com/serverless/sam/) with -[Gradle](https://gradle.org/) running the build. This example is configured for Java 1.8 only; in order to use a newer version, check out the Gradle +[Gradle](https://gradle.org/) running the build. This example is configured for Java 11 only; in order to use a newer version, check out the Gradle configuration guide [in the main project README](../../../README.md). You can also use `sam init` to create a new Gradle-powered Powertools application - choose to use the **AWS Quick Start Templates**, diff --git a/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts b/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts index 29a29b0c4..92b5fa383 100644 --- a/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts +++ b/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts @@ -21,19 +21,6 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") } -tasks.compileKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} - -tasks.compileTestKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} - -// If using JDK 11 or higher, use the following instead: -//kotlin { -// jvmToolchain(11) -//} \ No newline at end of file +kotlin { + jvmToolchain(11) +} \ No newline at end of file diff --git a/examples/powertools-examples-core-utilities/sam/pom.xml b/examples/powertools-examples-core-utilities/sam/pom.xml index a88150f4b..3ddecc5e4 100644 --- a/examples/powertools-examples-core-utilities/sam/pom.xml +++ b/examples/powertools-examples-core-utilities/sam/pom.xml @@ -10,8 +10,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.9.20 @@ -126,24 +126,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-core-utilities/serverless/pom.xml b/examples/powertools-examples-core-utilities/serverless/pom.xml index c92d0b653..7ebfdfc00 100644 --- a/examples/powertools-examples-core-utilities/serverless/pom.xml +++ b/examples/powertools-examples-core-utilities/serverless/pom.xml @@ -10,8 +10,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.9.20 @@ -59,6 +59,7 @@ + helloworld-lambda dev.aspectj @@ -126,24 +127,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-core-utilities/terraform/pom.xml b/examples/powertools-examples-core-utilities/terraform/pom.xml index d74ce7085..f508d9d3d 100644 --- a/examples/powertools-examples-core-utilities/terraform/pom.xml +++ b/examples/powertools-examples-core-utilities/terraform/pom.xml @@ -10,8 +10,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.9.20 @@ -145,24 +145,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-idempotency/pom.xml b/examples/powertools-examples-idempotency/pom.xml index 901074ddb..b7fd3d832 100644 --- a/examples/powertools-examples-idempotency/pom.xml +++ b/examples/powertools-examples-idempotency/pom.xml @@ -24,8 +24,8 @@ 2.20.0 - 1.8 - 1.8 + 11 + 11 1.9.20 @@ -198,24 +198,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-parameters/pom.xml b/examples/powertools-examples-parameters/pom.xml index cffab7a65..7a4af628c 100644 --- a/examples/powertools-examples-parameters/pom.xml +++ b/examples/powertools-examples-parameters/pom.xml @@ -8,8 +8,8 @@ Powertools for AWS Lambda (Java) library Examples - Parameters - 1.8 - 1.8 + 11 + 11 1.9.20 @@ -108,24 +108,4 @@ - - - - jdk8 - - (,11) - - - 1.9.7 - - - diff --git a/examples/powertools-examples-serialization/pom.xml b/examples/powertools-examples-serialization/pom.xml index 5d7036497..468c7d161 100644 --- a/examples/powertools-examples-serialization/pom.xml +++ b/examples/powertools-examples-serialization/pom.xml @@ -8,8 +8,8 @@ Powertools for AWS Lambda (Java) library Examples - Serialization - 1.8 - 1.8 + 11 + 11 @@ -37,14 +37,6 @@ - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - org.apache.maven.plugins diff --git a/examples/powertools-examples-validation/README.md b/examples/powertools-examples-validation/README.md index 3f6790b0c..2f2028301 100644 --- a/examples/powertools-examples-validation/README.md +++ b/examples/powertools-examples-validation/README.md @@ -15,7 +15,7 @@ started with SAM in [the examples directory](../README.md) To test the validation, we can POST a JSON object shaped like our schema: ```bash - curl -X POST https://[REST-API-ID].execute-api.[REGION].amazonaws.com/Prod/hello/ -H "Content-Type: application/json" -d '{"address": "https://checkip.amazonaws.com"}' + curl -X POST https://[REST-API-ID].execute-api.[REGION].amazonaws.com/Prod/hello/ -H "Content-Type: application/json" -d '{"id": 123,"name":"The Hitchhikers Guide to the Galaxy","price":10.99}' ``` If we break the schema - for instance, by removing one of the compulsory fields, diff --git a/pom.xml b/pom.xml index cad72dee1..97d90c011 100644 --- a/pom.xml +++ b/pom.xml @@ -69,8 +69,8 @@ - 1.8 - 1.8 + 11 + 11 2.20.0 2.15.3 2.21.0 From 0b180022024f52182c5ed72a8dbf48052510edca Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Wed, 29 Nov 2023 15:49:14 +0000 Subject: [PATCH 02/10] reverting pom to java 8 as change should only apply to examples --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 97d90c011..cad72dee1 100644 --- a/pom.xml +++ b/pom.xml @@ -69,8 +69,8 @@ - 11 - 11 + 1.8 + 1.8 2.20.0 2.15.3 2.21.0 From 0b1945f09028bf9c0eab31c773291cdd1f287ef7 Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Wed, 29 Nov 2023 16:08:58 +0000 Subject: [PATCH 03/10] updated workflow to not build examples in java 8 workflow --- .github/workflows/pr_build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index eb3cc053d..af9a4c81c 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -66,6 +66,10 @@ jobs: java-version: ${{ matrix.java }} cache: 'maven' - name: Build with Maven + if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory + run: mvn -B install --file pom.xml -pl '!examples' + - name: Build with Maven + if: !${{ matrix.java == '8' }} # If not 8 don't exclude the examples directory run: mvn -B install --file pom.xml - name: Build Gradle Example - Java if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8 From dd66e947aa9c086893ee1fa7becfd24070f5705a Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Wed, 29 Nov 2023 16:14:50 +0000 Subject: [PATCH 04/10] updated syntax of workflow --- .github/workflows/pr_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index af9a4c81c..002497b2d 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -69,7 +69,7 @@ jobs: if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory run: mvn -B install --file pom.xml -pl '!examples' - name: Build with Maven - if: !${{ matrix.java == '8' }} # If not 8 don't exclude the examples directory + if: ${{ ! matrix.java == '8' }} # If not 8 don't exclude the examples directory run: mvn -B install --file pom.xml - name: Build Gradle Example - Java if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8 From c93fcef568aa2b0e2ee27bf263cbd14d8a44100b Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Wed, 29 Nov 2023 17:02:37 +0000 Subject: [PATCH 05/10] excluding examples from spotbugs check for java 8 build --- .github/workflows/spotbugs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index d314107fa..f1b2b7e95 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -39,4 +39,4 @@ jobs: # path: '**/spotbugsXml.xml' # # Can be simplified post this issue is fixed https://github.com/jwgmeligmeyling/spotbugs-github-action/issues/9 - name: Build with Maven for spotbugs check to mark build as fail if voilations found - run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true \ No newline at end of file + run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true -pl '!examples' \ No newline at end of file From d3b2e3722fe3c3d442e66daa4e22ef9812a37e29 Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Wed, 29 Nov 2023 21:00:31 +0000 Subject: [PATCH 06/10] updated github actions workflow --- .github/workflows/pr_build.yml | 2 +- .github/workflows/spotbugs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 002497b2d..79a7e6f4f 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -67,7 +67,7 @@ jobs: cache: 'maven' - name: Build with Maven if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory - run: mvn -B install --file pom.xml -pl '!examples' + run: mvn -B install --file pom.xml -pl '!software.amazon.lambda:powertools-examples' - name: Build with Maven if: ${{ ! matrix.java == '8' }} # If not 8 don't exclude the examples directory run: mvn -B install --file pom.xml diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index f1b2b7e95..653794160 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -39,4 +39,4 @@ jobs: # path: '**/spotbugsXml.xml' # # Can be simplified post this issue is fixed https://github.com/jwgmeligmeyling/spotbugs-github-action/issues/9 - name: Build with Maven for spotbugs check to mark build as fail if voilations found - run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true -pl '!examples' \ No newline at end of file + run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true -pl '!software.amazon.lambda:powertools-examples' \ No newline at end of file From a2ad1fdc65ff230dc354f6b49228a892ea3fd79e Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Thu, 30 Nov 2023 09:58:34 +0000 Subject: [PATCH 07/10] updated workflows to have a comma seperated list of examples modules when java 8 to exclude --- .github/workflows/pr_build.yml | 2 +- .github/workflows/spotbugs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 79a7e6f4f..432585e72 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -67,7 +67,7 @@ jobs: cache: 'maven' - name: Build with Maven if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory - run: mvn -B install --file pom.xml -pl '!software.amazon.lambda:powertools-examples' + run: mvn -B install --file pom.xml -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples' - name: Build with Maven if: ${{ ! matrix.java == '8' }} # If not 8 don't exclude the examples directory run: mvn -B install --file pom.xml diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 653794160..67bdd0a73 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -39,4 +39,4 @@ jobs: # path: '**/spotbugsXml.xml' # # Can be simplified post this issue is fixed https://github.com/jwgmeligmeyling/spotbugs-github-action/issues/9 - name: Build with Maven for spotbugs check to mark build as fail if voilations found - run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true -pl '!software.amazon.lambda:powertools-examples' \ No newline at end of file + run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples' \ No newline at end of file From a271bfece8e4682abdf30950ef4e14f359bf9703 Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Thu, 30 Nov 2023 11:19:34 +0000 Subject: [PATCH 08/10] updating build syntax for non java 8 --- .github/workflows/pr_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 432585e72..aa140f3b2 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -69,7 +69,7 @@ jobs: if: ${{ matrix.java == '8' }} # If 8 exclude the examples directory run: mvn -B install --file pom.xml -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples' - name: Build with Maven - if: ${{ ! matrix.java == '8' }} # If not 8 don't exclude the examples directory + if: ${{ matrix.java != '8' }} # If not 8 don't exclude the examples directory run: mvn -B install --file pom.xml - name: Build Gradle Example - Java if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8 From 3db86b105a4ad316d4cc5dca69ef053a881da21d Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Thu, 30 Nov 2023 15:28:15 +0000 Subject: [PATCH 09/10] updating gradle config for Java 11+ --- .github/workflows/pr_build.yml | 4 ++-- .../powertools-examples-core-utilities/gradle/build.gradle | 4 ++-- .../gradle/gradle/wrapper/gradle-wrapper.properties | 2 +- .../kotlin/build.gradle.kts | 2 +- .../kotlin/gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index aa140f3b2..e86f49753 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -72,11 +72,11 @@ jobs: if: ${{ matrix.java != '8' }} # If not 8 don't exclude the examples directory run: mvn -B install --file pom.xml - name: Build Gradle Example - Java - if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8 + if: ${{ matrix.java != '8' }} working-directory: examples/powertools-examples-core-utilities/gradle run: ./gradlew build - name: Build Gradle Example - Kotlin - if: ${{ matrix.java == '8' }} # Gradle example can only be built on Java 8 + if: ${{ matrix.java != '8' }} working-directory: examples/powertools-examples-core-utilities/kotlin run: ./gradlew build - name: Setup Terraform diff --git a/examples/powertools-examples-core-utilities/gradle/build.gradle b/examples/powertools-examples-core-utilities/gradle/build.gradle index 93452cc81..03971c406 100644 --- a/examples/powertools-examples-core-utilities/gradle/build.gradle +++ b/examples/powertools-examples-core-utilities/gradle/build.gradle @@ -1,11 +1,11 @@ plugins { id 'java' - id "io.freefair.aspectj.post-compile-weaving" version "6.6.3" + id "io.freefair.aspectj.post-compile-weaving" version "8.2.2" } wrapper { - gradleVersion = "7.6.1" + gradleVersion = "8.5" } compileJava { diff --git a/examples/powertools-examples-core-utilities/gradle/gradle/wrapper/gradle-wrapper.properties b/examples/powertools-examples-core-utilities/gradle/gradle/wrapper/gradle-wrapper.properties index 0d23ac00c..1af9e0930 100644 --- a/examples/powertools-examples-core-utilities/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/examples/powertools-examples-core-utilities/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts b/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts index 92b5fa383..1c16db0db 100644 --- a/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts +++ b/examples/powertools-examples-core-utilities/kotlin/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("io.freefair.aspectj.post-compile-weaving") version "6.6.3" + id("io.freefair.aspectj.post-compile-weaving") version "8.2.2" kotlin("jvm") version "1.9.10" } diff --git a/examples/powertools-examples-core-utilities/kotlin/gradle/wrapper/gradle-wrapper.properties b/examples/powertools-examples-core-utilities/kotlin/gradle/wrapper/gradle-wrapper.properties index 0d23ac00c..1af9e0930 100644 --- a/examples/powertools-examples-core-utilities/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/powertools-examples-core-utilities/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 5d67821d378cac3dd854d4a7a0da78d95f02d51c Mon Sep 17 00:00:00 2001 From: jdoherty07 Date: Fri, 1 Dec 2023 09:19:27 +0000 Subject: [PATCH 10/10] updating the java version on spotbugs to 11 --- .github/workflows/spotbugs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spotbugs.yml b/.github/workflows/spotbugs.yml index 67bdd0a73..f0d50d8c5 100644 --- a/.github/workflows/spotbugs.yml +++ b/.github/workflows/spotbugs.yml @@ -28,7 +28,7 @@ jobs: uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: distribution: 'corretto' - java-version: 8 + java-version: 11 # https://github.com/jwgmeligmeyling/spotbugs-github-action/issues/6 # https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/ # Avoid complexity of git action with publishing report. Just build with spotbugs profile. @@ -39,4 +39,4 @@ jobs: # path: '**/spotbugsXml.xml' # # Can be simplified post this issue is fixed https://github.com/jwgmeligmeyling/spotbugs-github-action/issues/9 - name: Build with Maven for spotbugs check to mark build as fail if voilations found - run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true -pl '!software.amazon.lambda.examples:powertools-examples-idempotency,!software.amazon.lambda.examples:powertools-examples-batch,!software.amazon.lambda.examples:powertools-examples-cloudformation,!software.amazon.lambda.examples:powertools-examples-core-utilities-cdk,!software.amazon.lambda.examples:powertools-examples-core-utilities-sam,!software.amazon.lambda.examples:powertools-examples-core-utilities-serverless,!software.amazon.lambda.examples:powertools-examples-core-utilities-terraform,!software.amazon.lambda.examples:powertools-examples-parameters,!software.amazon.lambda.examples:powertools-examples-serialization,!software.amazon.lambda.examples:powertools-examples-validation,!software.amazon.lambda.examples:cdk,!software.amazon.lambda:powertools-examples' \ No newline at end of file + run: mvn -Pbuild-with-spotbugs -B install --file pom.xml -DskipTests -Dmaven.javadoc.skip=true -Dspotbugs.failOnError=true \ No newline at end of file