Skip to content

Commit 0359433

Browse files
authored
Merge branch 'v2' into dependabot/maven/v2/org.jacoco-jacoco-maven-plugin-0.8.13
2 parents 8c51f54 + b314321 commit 0359433

File tree

148 files changed

+7825
-2158
lines changed

Some content is hidden

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

148 files changed

+7825
-2158
lines changed

.github/workflows/auto-merge.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/workflows/check-e2e.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
- 11
5555
- 17
5656
- 21
57+
5758
steps:
5859
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
5960
- name: Setup java
@@ -68,4 +69,6 @@ jobs:
6869
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
6970
aws-region: us-east-1
7071
- name: Run e2e test with Maven
71-
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
72+
env:
73+
JAVA_VERSION: ${{ matrix.java }}
74+
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml

.github/workflows/docs-v2-snapshot.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/publish-v2-snapshot.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ jobs:
202202
cache: maven
203203
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
204204
gpg-passphrase: GPG_PASSPHRASE
205-
server-id: ossrh
205+
server-id: central
206206
server-username: MAVEN_USERNAME
207207
server-password: MAVEN_PASSWORD
208208
- name: Publish package
209209
run: mvn -Prelease clean deploy -DskipTests
210210
env:
211-
MAVEN_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
212-
MAVEN_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
211+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
212+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
213213
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
214214

215215
create_pr:
@@ -270,11 +270,9 @@ jobs:
270270
id-token: write
271271
environment: Docs
272272
steps:
273-
- id: download_source
274-
name: Download artifacts
275-
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.6.1
276-
with:
277-
name: source
273+
- id: checkout
274+
name: Checkout repository
275+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
278276
- name: Build
279277
run: |
280278
mkdir -p dist
@@ -290,4 +288,4 @@ jobs:
290288
run: |
291289
aws s3 sync \
292290
dist \
293-
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-java/
291+
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-java/${{ inputs.version }}/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ Powertools for AWS Lambda (Java) is available in Maven Central. You can use your
2222
<dependency>
2323
<groupId>software.amazon.lambda</groupId>
2424
<artifactId>powertools-tracing</artifactId>
25-
<version>2.0.0-SNAPSHOT</version>
25+
<version>2.0.0-RC1</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>software.amazon.lambda</groupId>
2929
<artifactId>powertools-logging</artifactId>
30-
<version>2.0.0-SNAPSHOT</version>
30+
<version>2.0.0-RC1</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>software.amazon.lambda</groupId>
3434
<artifactId>powertools-metrics</artifactId>
35-
<version>2.0.0-SNAPSHOT</version>
35+
<version>2.0.0-RC1</version>
3636
</dependency>
3737
...
3838
</dependencies>

docs/FAQs.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ title: FAQs
33
description: Frequently Asked Questions
44
---
55

6-
76
## How can I use Powertools for AWS Lambda (Java) with Lombok?
87

9-
Powertools uses `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.
8+
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.
109

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

1312
```xml hl_lines="2-6"
1413
<configuration>
15-
<forceAjcCompile>true</forceAjcCompile>
14+
<forceAjcCompile>true</forceAjcCompile>
1615
<sources/>
1716
<weaveDirectories>
1817
<weaveDirectory>${project.build.directory}/classes</weaveDirectory>
@@ -29,14 +28,14 @@ To enable in-place weaving feature you need to use following `aspectj-maven-plug
2928

3029
## How can I use Powertools for AWS Lambda (Java) with Kotlin projects?
3130

32-
Powertools uses `aspectj-maven-plugin` to compile-time weave (CTW) aspects into the project. When using it with Kotlin projects, it is required to `forceAjcCompile`.
33-
No explicit configuration should be required for gradle projects.
31+
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`.
32+
No explicit configuration should be required for gradle projects.
3433

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

3736
```xml hl_lines="2"
3837
<configuration>
39-
<forceAjcCompile>true</forceAjcCompile>
38+
<forceAjcCompile>true</forceAjcCompile>
4039
...
4140
<aspectLibraries>
4241
<aspectLibrary>
@@ -49,17 +48,17 @@ To enable `forceAjcCompile` you need to use following `aspectj-maven-plugin` con
4948

5049
## How can I use Powertools for AWS Lambda (Java) with the AWS CRT HTTP Client?
5150

52-
Powertools uses the `url-connection-client` as the default HTTP client. The `url-connection-client` is a lightweight HTTP client, which keeps the impact on Lambda cold starts to a minimum.
53-
With the [announcement](https://aws.amazon.com/blogs/developer/announcing-availability-of-the-aws-crt-http-client-in-the-aws-sdk-for-java-2-x/) of the `aws-crt-client` a new HTTP client has been released, which offers faster SDK startup time and smaller memory footprint.
51+
Utilities relying on AWS SDK clients use the `url-connection-client` as the default HTTP client. The `url-connection-client` is a lightweight HTTP client, which keeps the impact on Lambda cold starts to a minimum.
52+
With the [announcement](https://aws.amazon.com/blogs/developer/announcing-availability-of-the-aws-crt-http-client-in-the-aws-sdk-for-java-2-x/) of the `aws-crt-client` a new HTTP client has been released, which offers faster SDK startup time and smaller memory footprint.
5453

55-
Unfortunately, replacing the `url-connection-client` dependency with the `aws-crt-client` will not immediately improve the lambda cold start performance and memory footprint,
56-
as the default version of the dependency contains native system libraries for all supported runtimes and architectures (Linux, MacOS, Windows, AMD64, ARM64, etc). This makes the CRT client portable, without the user having to consider _where_ their code will run, but comes at the cost of JAR size.
54+
Unfortunately, replacing the `url-connection-client` dependency with the `aws-crt-client` will not immediately improve the lambda cold start performance and memory footprint,
55+
as the default version of the dependency contains native system libraries for all supported runtimes and architectures (Linux, MacOS, Windows, AMD64, ARM64, etc). This makes the CRT client portable, without the user having to consider _where_ their code will run, but comes at the cost of JAR size.
5756

5857
### Configuring dependencies
5958

60-
Using the `aws-crt-client` in your project requires the exclusion of the `url-connection-client` transitive dependency from the powertools dependency.
59+
Using the `aws-crt-client` in your project requires the exclusion of the `url-connection-client` transitive dependency from the `powertools-*` dependency.
6160

62-
```xml
61+
```xml
6362
<dependency>
6463
<groupId>software.amazon.lambda</groupId>
6564
<artifactId>powertools-parameters</artifactId>
@@ -72,8 +71,9 @@ Using the `aws-crt-client` in your project requires the exclusion of the `url-co
7271
</exclusions>
7372
</dependency>
7473
```
75-
Next, add the `aws-crt-client` and exclude the "generic" `aws-crt` dependency (contains all runtime libraries).
76-
Instead, set a specific classifier of the `aws-crt` to use the one for your target runtime: either `linux-x86_64` for a Lambda configured for x86 or `linux-aarch_64` for Lambda using arm64.
74+
75+
Next, add the `aws-crt-client` and exclude the "generic" `aws-crt` dependency (contains all runtime libraries).
76+
Instead, set a specific classifier of the `aws-crt` to use the one for your target runtime: either `linux-x86_64` for a Lambda configured for x86 or `linux-aarch_64` for Lambda using arm64.
7777

7878
!!! note "You will need to add a separate maven profile to build and debug locally when your development environment does not share the target architecture you are using in Lambda."
7979
By specifying the specific target runtime, we prevent other target runtimes from being included in the jar file, resulting in a smaller Lambda package and improved cold start times.
@@ -102,10 +102,11 @@ By specifying the specific target runtime, we prevent other target runtimes from
102102
```
103103

104104
### Explicitly set the AWS CRT HTTP Client
105-
After configuring the dependencies, it's required to explicitly specify the AWS SDK HTTP client.
106-
Depending on the Powertools module, there is a different way to configure the SDK client.
107105

108-
The following example shows how to use the Lambda Powertools Parameters module while leveraging the AWS CRT Client.
106+
After configuring the dependencies, it's required to explicitly specify the AWS SDK HTTP client.
107+
Depending on the utility you are using, there is a different way to configure the SDK client.
108+
109+
The following example shows how to use the Parameters module while leveraging the AWS CRT Client.
109110

110111
```java hl_lines="16 23-24"
111112
import static software.amazon.lambda.powertools.parameters.transform.Transformer.base64;
@@ -141,12 +142,12 @@ public class RequestHandlerWithParams implements RequestHandler<String, String>
141142
}
142143
```
143144

144-
The `aws-crt-client` was considered for adoption as the default HTTP client in Lambda Powertools for Java as mentioned in [Move SDK http client to CRT](https://github.com/aws-powertools/powertools-lambda-java/issues/1092),
145+
The `aws-crt-client` was considered for adoption as the default HTTP client in Powertools for AWS Lambda (Java) as mentioned in [Move SDK http client to CRT](https://github.com/aws-powertools/powertools-lambda-java/issues/1092),
145146
but due to the impact on the developer experience it was decided to stick with the `url-connection-client`.
146147

147148
## How can I use Powertools for AWS Lambda (Java) with GraalVM?
148149

149-
Powertools core utilities, i.e. [logging](./core/logging.md), [metrics](./core/metrics.md) and [tracing](./core/tracing.md), include the [GraalVM Reachability Metadata (GRM)](https://www.graalvm.org/latest/reference-manual/native-image/metadata/) in the `META-INF` directories of the respective JARs. You can find a working example of Serverless Application Model (SAM) based application in the [examples](../examples/powertools-examples-core-utilities/sam-graalvm/README.md) directory.
150+
Core utilities, i.e. [logging](./core/logging.md), [metrics](./core/metrics.md) and [tracing](./core/tracing.md), include the [GraalVM Reachability Metadata (GRM)](https://www.graalvm.org/latest/reference-manual/native-image/metadata/) in the `META-INF` directories of the respective JARs. You can find a working example of Serverless Application Model (SAM) based application in the [examples](../examples/powertools-examples-core-utilities/sam-graalvm/README.md) directory.
150151

151152
Below, you find typical steps you need to follow in a Maven based Java project:
152153

@@ -157,6 +158,7 @@ export JAVA_HOME=<path to GraalVM>
157158
```
158159

159160
### Use log4j `>2.24.0`
161+
160162
Log4j version `2.24.0` adds [support for GraalVM](https://github.com/apache/logging-log4j2/issues/1539#issuecomment-2106766878). Depending on your project's dependency hierarchy, older version of log4j might be included in the final dependency graph. Make sure version `>2.24.0` of these dependencies are used by your Maven project:
161163

162164
```xml
@@ -245,10 +247,11 @@ Create a Docker image using a `Dockerfile` like [this](../examples/powertools-ex
245247
docker build --platform linux/amd64 . -t your-org/your-app-graalvm-builder
246248
```
247249

248-
Create the native image of you Lambda function using the Docker command below.
250+
Create the native image of you Lambda function using the Docker command below.
249251

250252
```shell
251253
docker run --platform linux/amd64 -it -v `pwd`:`pwd` -w `pwd` -v ~/.m2:/root/.m2 your-org/your-app-graalvm-builder mvn clean -Pnative-image package
252254

253255
```
256+
254257
The native image is created in the `target/` directory.

0 commit comments

Comments
 (0)