Skip to content

Commit b05531e

Browse files
authored
Merge branch 'main' into gh-actions-hash
2 parents b7cce0f + 4c42359 commit b05531e

File tree

146 files changed

+4898
-813
lines changed

Some content is hidden

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

146 files changed

+4898
-813
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
java-version: ${{ matrix.java }}
6262
cache: 'maven'
6363
- name: Build with Maven
64-
run: mvn -Pbuild-without-spotbugs -B package --file pom.xml
64+
run: mvn -B install --file pom.xml
6565
- name: Upload coverage to Codecov
6666
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
6767
if: ${{ matrix.java == '11' }} # publish results once

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
RELEASE_TAG_VERSION=${{ github.event.release.tag_name }}
2626
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
2727
- name: Publish package
28-
run: mvn -P sign,build-without-spotbugs clean deploy -DskipTests
28+
run: mvn -Prelease clean deploy -DskipTests
2929
env:
3030
MAVEN_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
3131
MAVEN_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}

.github/workflows/run-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
4646
aws-region: ${{ env.AWS_DEFAULT_REGION }}
4747
- name: Run e2e test with Maven
48-
run: mvn -Pbuild-without-spotbugs -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml
48+
run: mvn -DskipTests install --file pom.xml && mvn -Pe2e -B verify --file powertools-e2e-tests/pom.xml

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) fo
88

99
## [Unreleased]
1010

11+
## [1.16.1] - 2023-07-19
12+
13+
* Fix: idempotency timeout bug (#1285) by @scottgerring
14+
* Fix: ParamManager cannot provide default SSM & Secrets providers (#1282) by @jeromevdl
15+
* Fix: Handle batch failures in FIFO queues correctly (#1183) by @scottgerring
16+
* Deps: Bump third party dependencies to the latest versions.
17+
18+
19+
## [1.16.0] - 2023-06-29
20+
21+
22+
### Added
23+
* Feature: Add AppConfig provider to parameters module (#1104) by @scottgerring
24+
25+
### Maintenance
26+
* Fix: missing idempotency key should not persist any data (#1201) by @jeromevdl
27+
* Fix:Removing env var credentials provider as default. (#1161) by @msailes
28+
* Chore: Swap implementation of `aspectj-maven-plugin` to support Java 17 (#1172) by @mriccia
29+
* Test: end-to-end tests for core modules and idempotency (#970) by @jeromevdl
30+
* Chore: cleanup spotbugs maven profiles (#1236) by @jeromevdl
31+
* Chore: removing logback from all components (#1227) by @jeromevdl
32+
* Chore: Roll SLF4J log4j bindings to v2 (#1190) by @scottgerring
33+
* Deps: Bump third party dependencies to the latest versions.
34+
35+
1136
## [1.15.0] - 2023-03-20
1237

1338
### Added

README.md

Lines changed: 114 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,34 @@ Powertools for AWS Lambda (Java) is a developer toolkit to implement Serverless
1313

1414
Powertools for AWS Lambda (Java) is available in Maven Central. You can use your favourite dependency management tool to install it
1515

16-
* [maven](https://maven.apache.org/):
16+
#### Maven:
1717
```xml
1818
<dependencies>
1919
...
2020
<dependency>
2121
<groupId>software.amazon.lambda</groupId>
2222
<artifactId>powertools-tracing</artifactId>
23-
<version>1.15.0</version>
23+
<version>1.16.1</version>
2424
</dependency>
2525
<dependency>
2626
<groupId>software.amazon.lambda</groupId>
2727
<artifactId>powertools-logging</artifactId>
28-
<version>1.15.0</version>
28+
<version>1.16.1</version>
2929
</dependency>
3030
<dependency>
3131
<groupId>software.amazon.lambda</groupId>
3232
<artifactId>powertools-metrics</artifactId>
33-
<version>1.15.0</version>
33+
<version>1.16.1</version>
3434
</dependency>
3535
...
3636
</dependencies>
3737
```
3838

39-
And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project:
39+
Next, configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project. A different configuration is needed for projects on Java 8.
4040

41+
<details>
42+
<summary><b>Maven - Java 11 and newer</b></summary>
43+
4144
```xml
4245
<build>
4346
<plugins>
@@ -77,13 +80,118 @@ And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambd
7780
</plugins>
7881
</build>
7982
```
83+
</details>
8084

81-
## Example
85+
<details>
86+
<summary><b>Maven - Java 8</b></summary>
87+
88+
```xml
89+
<build>
90+
<plugins>
91+
...
92+
<plugin>
93+
<groupId>org.codehaus.mojo</groupId>
94+
<artifactId>aspectj-maven-plugin</artifactId>
95+
<version>1.14.0</version>
96+
<configuration>
97+
<source>1.8</source>
98+
<target>1.8</target>
99+
<complianceLevel>1.8</complianceLevel>
100+
<aspectLibraries>
101+
<aspectLibrary>
102+
<groupId>software.amazon.lambda</groupId>
103+
<artifactId>powertools-logging</artifactId>
104+
</aspectLibrary>
105+
<aspectLibrary>
106+
<groupId>software.amazon.lambda</groupId>
107+
<artifactId>powertools-tracing</artifactId>
108+
</aspectLibrary>
109+
<aspectLibrary>
110+
<groupId>software.amazon.lambda</groupId>
111+
<artifactId>powertools-metrics</artifactId>
112+
</aspectLibrary>
113+
</aspectLibraries>
114+
</configuration>
115+
<executions>
116+
<execution>
117+
<goals>
118+
<goal>compile</goal>
119+
</goals>
120+
</execution>
121+
</executions>
122+
</plugin>
123+
...
124+
</plugins>
125+
</build>
126+
```
127+
</details>
128+
129+
<details>
130+
<summary><b>Gradle - Java 11+</b></summary>
131+
132+
```groovy
133+
plugins {
134+
id 'java'
135+
id 'io.freefair.aspectj.post-compile-weaving' version '8.1.0'
136+
}
137+
138+
repositories {
139+
mavenCentral()
140+
}
141+
142+
dependencies {
143+
aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
144+
aspect 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}'
145+
aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
146+
}
147+
148+
sourceCompatibility = 11
149+
targetCompatibility = 11
150+
```
151+
</details>
152+
153+
<details>
154+
<summary><b>Gradle - Java 8</b></summary>
155+
156+
```groovy
157+
plugins {
158+
id 'java'
159+
id 'io.freefair.aspectj.post-compile-weaving' version '6.6.3'
160+
}
161+
162+
repositories {
163+
mavenCentral()
164+
}
165+
166+
dependencies {
167+
aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
168+
aspect 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}'
169+
aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
170+
}
171+
172+
sourceCompatibility = 1.8
173+
targetCompatibility = 1.8
174+
```
175+
</details>
176+
177+
## Examples
82178

83179
See the **[examples](examples)** directory for example projects showcasing usage of different utilities.
84180

85181
Have a demo project to contribute which showcase usage of different utilities from powertools? We are happy to accept it [here](CONTRIBUTING.md#security-issue-notifications).
86182

183+
## How to support Powertools for AWS Lambda (Java)?
184+
185+
### Becoming a reference customer
186+
187+
Knowing which companies are using this library is important to help prioritize the project internally. If your company is using Powertools for AWS Lambda (Java), you can request to have your name and logo added to the README file by raising a [Support Powertools for AWS Lambda (Java) (become a reference)](https://github.com/aws-powertools/powertools-lambda-java/issues/new?assignees=&labels=customer-reference&template=support_powertools.yml&title=%5BSupport+Lambda+Powertools%5D%3A+%3Cyour+organization+name%3E) issue.
188+
189+
The following companies, among others, use Powertools:
190+
191+
* [Capital One](https://www.capitalone.com/)
192+
* [CPQi (Exadel Financial Services)](https://cpqi.com/)
193+
* [Europace AG](https://europace.de/)
194+
87195
## Credits
88196

89197
* [MkDocs](https://www.mkdocs.org/)

docs/core/logging.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,141 @@ Logging provides an opinionated logger with output structured as JSON.
1111
* Log Lambda event when instructed, disabled by default, can be enabled explicitly via annotation param
1212
* Append additional keys to structured log at any point in time
1313

14+
## Install
15+
16+
Depending on your version of Java (either Java 1.8 or 11+), the configuration slightly changes.
17+
18+
=== "Maven Java 11+"
19+
20+
```xml hl_lines="3-7 16 18 24-27"
21+
<dependencies>
22+
...
23+
<dependency>
24+
<groupId>software.amazon.lambda</groupId>
25+
<artifactId>powertools-logging</artifactId>
26+
<version>{{ powertools.version }}</version>
27+
</dependency>
28+
...
29+
</dependencies>
30+
...
31+
<!-- configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project -->
32+
<build>
33+
<plugins>
34+
...
35+
<plugin>
36+
<groupId>dev.aspectj</groupId>
37+
<artifactId>aspectj-maven-plugin</artifactId>
38+
<version>1.13.1</version>
39+
<configuration>
40+
<source>11</source> <!-- or higher -->
41+
<target>11</target> <!-- or higher -->
42+
<complianceLevel>11</complianceLevel> <!-- or higher -->
43+
<aspectLibraries>
44+
<aspectLibrary>
45+
<groupId>software.amazon.lambda</groupId>
46+
<artifactId>powertools-logging</artifactId>
47+
</aspectLibrary>
48+
</aspectLibraries>
49+
</configuration>
50+
<executions>
51+
<execution>
52+
<goals>
53+
<goal>compile</goal>
54+
</goals>
55+
</execution>
56+
</executions>
57+
</plugin>
58+
...
59+
</plugins>
60+
</build>
61+
```
62+
63+
=== "Maven Java 1.8"
64+
65+
```xml hl_lines="3-7 16 18 24-27"
66+
<dependencies>
67+
...
68+
<dependency>
69+
<groupId>software.amazon.lambda</groupId>
70+
<artifactId>powertools-logging</artifactId>
71+
<version>{{ powertools.version }}</version>
72+
</dependency>
73+
...
74+
</dependencies>
75+
...
76+
<!-- configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project -->
77+
<build>
78+
<plugins>
79+
...
80+
<plugin>
81+
<groupId>org.codehaus.mojo</groupId>
82+
<artifactId>aspectj-maven-plugin</artifactId>
83+
<version>1.14.0</version>
84+
<configuration>
85+
<source>1.8</source>
86+
<target>1.8</target>
87+
<complianceLevel>1.8</complianceLevel>
88+
<aspectLibraries>
89+
<aspectLibrary>
90+
<groupId>software.amazon.lambda</groupId>
91+
<artifactId>powertools-logging</artifactId>
92+
</aspectLibrary>
93+
</aspectLibraries>
94+
</configuration>
95+
<executions>
96+
<execution>
97+
<goals>
98+
<goal>compile</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
</plugin>
103+
...
104+
</plugins>
105+
</build>
106+
```
107+
108+
=== "Gradle Java 11+"
109+
110+
```groovy hl_lines="3 11"
111+
plugins {
112+
id 'java'
113+
id 'io.freefair.aspectj.post-compile-weaving' version '8.1.0'
114+
}
115+
116+
repositories {
117+
mavenCentral()
118+
}
119+
120+
dependencies {
121+
aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
122+
}
123+
124+
sourceCompatibility = 11
125+
targetCompatibility = 11
126+
```
127+
128+
=== "Gradle Java 1.8"
129+
130+
```groovy hl_lines="3 11"
131+
plugins {
132+
id 'java'
133+
id 'io.freefair.aspectj.post-compile-weaving' version '6.6.3'
134+
}
135+
136+
repositories {
137+
mavenCentral()
138+
}
139+
140+
dependencies {
141+
aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
142+
}
143+
144+
sourceCompatibility = 1.8
145+
targetCompatibility = 1.8
146+
```
147+
148+
14149
## Initialization
15150

16151
Powertools for AWS Lambda (Java) extends the functionality of Log4J. Below is an example `#!xml log4j2.xml` file, with the `JsonTemplateLayout` using `#!json LambdaJsonLayout.json` configured.

0 commit comments

Comments
 (0)