Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Powertools for AWS Lambda (Java) is available in Maven Central. You can use your
</dependency>
<dependency>
<groupId>software.amazon.lambda</groupId>
<artifactId>powertools-logging</artifactId>
<artifactId>powertools-logging-log4j</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -116,6 +116,7 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam
aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
aspect 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}'
aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
implementation 'software.amazon.lambda:powertools-logging-log4j:{{ powertools.version }}'
implementation "org.aspectj:aspectjrt:1.9.22"
}

Expand All @@ -126,10 +127,10 @@ Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lam


### Java Compatibility
Powertools for AWS Lambda (Java) supports all Java version from 11 up to 21 as well as the
[corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).
Powertools for AWS Lambda (Java) supports all Java versions from 11 up to 25 inline with the [corresponding Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).

For the modules that provide annotations, Powertools for AWS Lambda (Java) leverages the **aspectj** library.
You may need to add the good version of `aspectjrt` to your dependencies based on the JDK used for building your function:
You may need to add the appropriate version of `aspectjrt` to your dependencies based on the JDK used for building your function:

```xml
<dependency>
Expand All @@ -142,12 +143,13 @@ You may need to add the good version of `aspectjrt` to your dependencies based o
<details>
<summary><b>JDK - aspectj dependency matrix</b></summary>

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:

| JDK version | aspectj version |
|-------------|------------------------|
| `11-17` | `1.9.20.1` (or higher) |
| `21` | `1.9.21` (or higher) |

More info [here](https://github.com/aws-powertools/powertools-lambda-java/pull/1519/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R191).
| `25` | `1.9.25` (or higher) |

</details>

Expand Down
4 changes: 4 additions & 0 deletions docs/FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ description: Frequently Asked Questions

Many utilities in this library use `aspectj-maven-plugin` to compile-time weave (CTW) aspects into the project. In case you want to use `Lombok` or other compile-time preprocessor for your project, it is required to change `aspectj-maven-plugin` configuration to enable in-place weaving feature. Otherwise the plugin will ignore changes introduced by `Lombok` and will use `.java` files as a source.

Alternatively, you can use the [functional approach](./usage-patterns.md#functional-approach) which does not require AspectJ configuration.

To enable in-place weaving feature you need to use following `aspectj-maven-plugin` configuration:

```xml hl_lines="2-6"
Expand All @@ -31,6 +33,8 @@ To enable in-place weaving feature you need to use following `aspectj-maven-plug
Many utilities use `aspectj-maven-plugin` to compile-time weave (CTW) aspects into the project. When using it with Kotlin projects, it is required to `forceAjcCompile`.
No explicit configuration should be required for gradle projects.

Alternatively, you can use the [functional approach](./usage-patterns.md#functional-approach) which does not require AspectJ configuration.

To enable `forceAjcCompile` you need to use following `aspectj-maven-plugin` configuration:

```xml hl_lines="2"
Expand Down
Loading
Loading