Skip to content

Commit 90d126b

Browse files
committed
Update all examples, dependencies, and documentation to use Java 17 as the minimum supported version.
1 parent c54e769 commit 90d126b

62 files changed

Lines changed: 164 additions & 182 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/check-build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ jobs:
7272
strategy:
7373
matrix:
7474
java:
75-
- 11
7675
- 17
7776
- 21
7877
- 25

.github/workflows/check-e2e.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
max-parallel: 20
100100
matrix:
101101
java:
102-
- 11
103102
- 17
104103
- 21
105104
- 25

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-docs-website:
99

1010
docs-local-docker:
1111
docker build -t squidfunk/mkdocs-material ./docs/
12-
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
12+
docker run --rm -it -p 8000:8000 -v $(CURDIR):/docs squidfunk/mkdocs-material
1313

1414
test:
1515
mvn test

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam
5252
<artifactId>aspectj-maven-plugin</artifactId>
5353
<version>1.14</version>
5454
<configuration>
55-
<source>11</source>
56-
<target>11</target>
57-
<complianceLevel>11</complianceLevel>
55+
<source>17</source>
56+
<target>17</target>
57+
<complianceLevel>17</complianceLevel>
5858
<aspectLibraries>
5959
<aspectLibrary>
6060
<groupId>software.amazon.lambda</groupId>
@@ -120,14 +120,14 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam
120120
implementation "org.aspectj:aspectjrt:1.9.22"
121121
}
122122
123-
sourceCompatibility = 11
124-
targetCompatibility = 11
123+
sourceCompatibility = 17
124+
targetCompatibility = 17
125125
```
126126
</details>
127127

128128

129129
### Java Compatibility
130-
Powertools for AWS Lambda (Java) supports all Java versions from 11 to 25 in line with the [corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
130+
Powertools for AWS Lambda (Java) supports all Java versions from 17 to 25 in line with the [corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
131131

132132
For the modules that provide annotations, Powertools for AWS Lambda (Java) leverages the **aspectj** library.
133133
You may need to add the appropriate version of `aspectjrt` to your dependencies based on the JDK used for building your function:
@@ -146,10 +146,10 @@ You may need to add the appropriate version of `aspectjrt` to your dependencies
146146
Use the following [dependency matrix](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/release/JavaVersionCompatibility.adoc) to understand which AspectJ version to use based on your JDK version:
147147

148148
| JDK version | aspectj version |
149-
|-------------|------------------------|
150-
| `11-17` | `1.9.20.1` (or higher) |
151-
| `21` | `1.9.21` (or higher) |
152-
| `25` | `1.9.25` (or higher) |
149+
|-----------|------------------------|
150+
| `17` | `1.9.20.1` (or higher) |
151+
| `21` | `1.9.21` (or higher) |
152+
| `25` | `1.9.25` (or higher) |
153153

154154
</details>
155155

docs/core/logging.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ Depending on preference, you must choose to use either _log4j2_ or _logback_ as
5454
<artifactId>aspectj-maven-plugin</artifactId>
5555
<version>1.14</version>
5656
<configuration>
57-
<source>11</source> <!-- or higher -->
58-
<target>11</target> <!-- or higher -->
59-
<complianceLevel>11</complianceLevel> <!-- or higher -->
57+
<source>17</source> <!-- or higher -->
58+
<target>17</target> <!-- or higher -->
59+
<complianceLevel>17</complianceLevel> <!-- or higher -->
6060
<aspectLibraries>
6161
<aspectLibrary>
6262
<groupId>software.amazon.lambda</groupId>
@@ -113,9 +113,9 @@ Depending on preference, you must choose to use either _log4j2_ or _logback_ as
113113
<artifactId>aspectj-maven-plugin</artifactId>
114114
<version>1.14</version>
115115
<configuration>
116-
<source>11</source> <!-- or higher -->
117-
<target>11</target> <!-- or higher -->
118-
<complianceLevel>11</complianceLevel> <!-- or higher -->
116+
<source>17</source> <!-- or higher -->
117+
<target>17</target> <!-- or higher -->
118+
<complianceLevel>17</complianceLevel> <!-- or higher -->
119119
<aspectLibraries>
120120
<aspectLibrary>
121121
<groupId>software.amazon.lambda</groupId>
@@ -163,8 +163,8 @@ Depending on preference, you must choose to use either _log4j2_ or _logback_ as
163163
implementation 'software.amazon.lambda:powertools-logging-log4j:{{ powertools.version }}'
164164
}
165165
166-
sourceCompatibility = 11
167-
targetCompatibility = 11
166+
sourceCompatibility = 17
167+
targetCompatibility = 17
168168
```
169169

170170
=== "logback"
@@ -184,8 +184,8 @@ Depending on preference, you must choose to use either _log4j2_ or _logback_ as
184184
implementation 'software.amazon.lambda:powertools-logging-logback:{{ powertools.version }}'
185185
}
186186
187-
sourceCompatibility = 11
188-
targetCompatibility = 11
187+
sourceCompatibility = 17
188+
targetCompatibility = 17
189189
```
190190

191191

docs/core/metrics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ Visit the AWS documentation for a complete explanation for [Amazon CloudWatch co
5757
<artifactId>aspectj-maven-plugin</artifactId>
5858
<version>1.14</version>
5959
<configuration>
60-
<source>11</source> <!-- or higher -->
61-
<target>11</target> <!-- or higher -->
62-
<complianceLevel>11</complianceLevel> <!-- or higher -->
60+
<source>17</source> <!-- or higher -->
61+
<target>17</target> <!-- or higher -->
62+
<complianceLevel>17</complianceLevel> <!-- or higher -->
6363
<aspectLibraries>
6464
<aspectLibrary>
6565
<groupId>software.amazon.lambda</groupId>
@@ -105,8 +105,8 @@ Visit the AWS documentation for a complete explanation for [Amazon CloudWatch co
105105
implementation 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}' // Use this instead of 'aspect' when using the functional approach
106106
}
107107

108-
sourceCompatibility = 11
109-
targetCompatibility = 11
108+
sourceCompatibility = 17
109+
targetCompatibility = 17
110110
```
111111

112112
## Getting started
@@ -181,7 +181,7 @@ For most use-cases, we recommend using Environment variables and only overwrite
181181
Type: AWS::Serverless::Function
182182
Properties:
183183
...
184-
Runtime: java11
184+
Runtime: java17
185185
Environment:
186186
Variables:
187187
POWERTOOLS_SERVICE_NAME: payment

docs/core/tracing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ a provides functionality to reduce the overhead of performing common tracing tas
4141
<artifactId>aspectj-maven-plugin</artifactId>
4242
<version>1.14</version>
4343
<configuration>
44-
<source>11</source> <!-- or higher -->
45-
<target>11</target> <!-- or higher -->
46-
<complianceLevel>11</complianceLevel> <!-- or higher -->
44+
<source>17</source> <!-- or higher -->
45+
<target>17</target> <!-- or higher -->
46+
<complianceLevel>17</complianceLevel> <!-- or higher -->
4747
<aspectLibraries>
4848
<aspectLibrary>
4949
<groupId>software.amazon.lambda</groupId>
@@ -89,8 +89,8 @@ a provides functionality to reduce the overhead of performing common tracing tas
8989
implementation 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}' // Use this instead of 'aspect' when using the functional approach
9090
}
9191
92-
sourceCompatibility = 11 // or higher
93-
targetCompatibility = 11 // or higher
92+
sourceCompatibility = 17 // or higher
93+
targetCompatibility = 17 // or higher
9494
```
9595

9696
## Initialization
@@ -107,7 +107,7 @@ Before your use this utility, your AWS Lambda function [must have permissions](h
107107
Type: AWS::Serverless::Function
108108
Properties:
109109
...
110-
Runtime: java11
110+
Runtime: java17
111111

112112
Tracing: Active
113113
Environment:
@@ -217,7 +217,7 @@ specifying a different `captureMode` to always record response, exception, both,
217217
Type: AWS::Serverless::Function
218218
Properties:
219219
...
220-
Runtime: java11
220+
Runtime: java17
221221

222222
Tracing: Active
223223
Environment:

docs/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ Powertools for AWS Lambda (Java) dependencies are available in Maven Central. Yo
118118
<artifactId>aspectj-maven-plugin</artifactId>
119119
<version>1.14</version>
120120
<configuration>
121-
<source>11</source> <!-- or higher -->
122-
<target>11</target> <!-- or higher -->
123-
<complianceLevel>11</complianceLevel> <!-- or higher -->
121+
<source>17</source> <!-- or higher -->
122+
<target>17</target> <!-- or higher -->
123+
<complianceLevel>17</complianceLevel> <!-- or higher -->
124124
<aspectLibraries>
125125
<aspectLibrary>
126126
<groupId>software.amazon.lambda</groupId>
@@ -183,15 +183,15 @@ Powertools for AWS Lambda (Java) dependencies are available in Maven Central. Yo
183183
aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
184184
}
185185
186-
sourceCompatibility = 11
187-
targetCompatibility = 11
186+
sourceCompatibility = 17
187+
targetCompatibility = 17
188188
```
189189

190190
???+ tip "Don't want to use AspectJ?"
191191
Powertools for AWS Lambda (Java) now provides a functional API that doesn't require AspectJ configuration. Learn more about the [functional approach](./usage-patterns.md#functional-approach).
192192

193193
### Java Compatibility
194-
Powertools for AWS Lambda (Java) supports all Java versions from 11 to 25 in line with the [corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
194+
Powertools for AWS Lambda (Java) supports all Java versions from 17 to 25 in line with the [corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
195195

196196
In addition to the functional approach, [Logging](./core/logging.md), [Metrics](./core/metrics.md), [Tracing](./core/tracing.md), [Parameters](./utilities/parameters.md), [Idempotency](./utilities/idempotency.md), [Validation](./utilities/validation.md), and [Large Messages](./utilities/large_messages.md) utilities support annotations using AspectJ, which require configuration of the `aspectjrt` runtime library.
197197

@@ -208,10 +208,10 @@ You may need to add the appropriate version of `aspectjrt` to your dependencies
208208
Use the following [dependency matrix](https://github.com/eclipse-aspectj/aspectj/blob/master/docs/release/JavaVersionCompatibility.adoc) to understand which AspectJ version to use based on your JDK version:
209209

210210
| JDK version | aspectj version |
211-
|-------------|------------------------|
212-
| `11-17` | `1.9.20.1` (or higher) |
213-
| `21` | `1.9.21` (or higher) |
214-
| `25` | `1.9.25` (or higher) |
211+
|----------|------------------------|
212+
| `17` | `1.9.20.1` (or higher) |
213+
| `21` | `1.9.21` (or higher) |
214+
| `25` | `1.9.25` (or higher) |
215215

216216
## Environment variables
217217

docs/upgrade.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@ We've made minimal breaking changes to make your transition to `v2` as smooth as
2222

2323
The following table shows a summary of the changes made in `v2` and whether code changes are necessary. Each change that requires a code change links to a section below explaining more details.
2424

25-
| Area | Change | Code change required |
26-
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
27-
| **Logging** | The [logging module was re-designed](#redesigned-logging-utility) from scratch to support popular Java logging paradigms and libraries like `log4j2`, `logback`, and `slf4j`. | Yes |
28-
| **Metrics** | [Changed public interface](#updated-metrics-utility-interface) to remove direct coupling with `aws-embedded-metrics-java`. | Yes |
29-
| **Tracing** | [Removed deprecated `captureResponse` and `captureError` options](#deprecated-capture-mode-related-tracing-annotation-parameters) on `@Tracing` annotation. | Yes |
30-
| **Idempotency** | The [`powertools-idempotency` module was split by provider](#idempotency-utility-split-into-sub-modules-by-provider) to improve modularity and reduce the deployment package size. | Yes |
31-
| **Idempotency** | Updated `IdempotencyConfig` interface to support addition of response hooks. | No |
32-
| **Parameters** | The [`powertools-parameters` module was split by provider](#parameters-utility-split-into-sub-modules-by-provider) to improve modularity and reduce the deployment package size. | Yes |
25+
| Area | Change | Code change required |
26+
| -------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -------------------- |
27+
| **Logging** | The [logging module was re-designed](#redesigned-logging-utility) from scratch to support popular Java logging paradigms and libraries like `log4j2`, `logback`, and `slf4j`. | Yes |
28+
| **Metrics** | [Changed public interface](#updated-metrics-utility-interface) to remove direct coupling with `aws-embedded-metrics-java`. | Yes |
29+
| **Tracing** | [Removed deprecated `captureResponse` and `captureError` options](#deprecated-capture-mode-related-tracing-annotation-parameters) on `@Tracing` annotation. | Yes |
30+
| **Idempotency** | The [`powertools-idempotency` module was split by provider](#idempotency-utility-split-into-sub-modules-by-provider) to improve modularity and reduce the deployment package size. | Yes |
31+
| **Idempotency** | Updated `IdempotencyConfig` interface to support addition of response hooks. | No |
32+
| **Parameters** | The [`powertools-parameters` module was split by provider](#parameters-utility-split-into-sub-modules-by-provider) to improve modularity and reduce the deployment package size. | Yes |
3333
| **Batch Processing** | [Removed deprecated `powertools-sqs` module](#removed-powertools-sqs-module-in-favor-of-powertools-batch) in favor of the more generic [Batch Processing](./utilities/batch.md) utility. | Yes |
34-
| **Batch Processing** | Updated Batch Processing `BatchMessageHandler` interface to add support for parallel processing. | No |
35-
| **Validation** | The `@Validation` utility returns 4xx error codes instead of 5xx error codes when used with API Gateway now. | No |
36-
| **Validation** | Validating batch event sources now adds failed events as partial batch failures and does not fail the whole batch anymore. | No |
37-
| **Custom Resources** | [Removed deprecated `Response.failed()` and `Response.success()` methods](#custom-resources-updates-the-response-class). | Yes |
38-
| **Custom Resources** | Changed interface of `Response` class to add an optional `reason` field. | No |
39-
| **Dependencies** | Renamed `powertools-core` to `powertools-common`. This module should not be used as direct dependency and is listed here for completeness. | No |
40-
| **Dependencies** | [Removed `org.aspectj.aspectjrt` as project dependency](#aspectj-runtime-not-included-by-default-anymore) in favor of consumers including the version they prefer. | Yes |
41-
| **Language support** | Removed support for Java 8. The minimum required Java version is Java 11. | N/A |
34+
| **Batch Processing** | Updated Batch Processing `BatchMessageHandler` interface to add support for parallel processing. | No |
35+
| **Validation** | The `@Validation` utility returns 4xx error codes instead of 5xx error codes when used with API Gateway now. | No |
36+
| **Validation** | Validating batch event sources now adds failed events as partial batch failures and does not fail the whole batch anymore. | No |
37+
| **Custom Resources** | [Removed deprecated `Response.failed()` and `Response.success()` methods](#custom-resources-updates-the-response-class). | Yes |
38+
| **Custom Resources** | Changed interface of `Response` class to add an optional `reason` field. | No |
39+
| **Dependencies** | Renamed `powertools-core` to `powertools-common`. This module should not be used as direct dependency and is listed here for completeness. | No |
40+
| **Dependencies** | [Removed `org.aspectj.aspectjrt` as project dependency](#aspectj-runtime-not-included-by-default-anymore) in favor of consumers including the version they prefer. | Yes |
41+
| **Language support** | Removed support for Java 11. The minimum required Java version is Java 17. | N/A |
4242

4343
### First Steps
4444

4545
Before you start, we suggest making a copy of your current working project or create a new branch with `git`.
4646

47-
1. **Upgrade** Java to at least version 11. While version 11 is supported, we recommend using the [newest available LTS version](https://downloads.corretto.aws/#/downloads){target="\_blank"} of Java.
47+
1. **Upgrade** Java to at least version 17. While version 17 is supported, we recommend using the [newest available LTS version](https://downloads.corretto.aws/#/downloads){target="\_blank"} of Java.
4848
2. **Review** the following section to confirm if you need to make changes to your code.
4949

5050
## Redesigned Logging Utility

0 commit comments

Comments
 (0)