@@ -13,31 +13,32 @@ Powertools for AWS Lambda (Java) is a developer toolkit to implement Serverless
1313
1414Powertools 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.17.0-SNAPSHOT </version >
23+ <version >1.16.0 </version >
2424 </dependency >
2525 <dependency >
2626 <groupId >software.amazon.lambda</groupId >
2727 <artifactId >powertools-logging</artifactId >
28- <version >1.17.0-SNAPSHOT </version >
28+ <version >1.16.0 </version >
2929 </dependency >
3030 <dependency >
3131 <groupId >software.amazon.lambda</groupId >
3232 <artifactId >powertools-metrics</artifactId >
33- <version >1.17.0-SNAPSHOT </version >
33+ <version >1.16.0 </version >
3434 </dependency >
3535 ...
3636</dependencies >
3737```
3838
3939And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project:
4040
41+ For Java 11+, use the following:
4142``` xml
4243<build >
4344 <plugins >
@@ -78,6 +79,93 @@ And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambd
7879</build >
7980```
8081
82+ For Java 8, use the following:
83+ ``` xml
84+ <build >
85+ <plugins >
86+ ...
87+ <plugin >
88+ <groupId >org.codehaus.mojo</groupId >
89+ <artifactId >aspectj-maven-plugin</artifactId >
90+ <version >1.14.0</version >
91+ <configuration >
92+ <source >1.8</source >
93+ <target >1.8</target >
94+ <complianceLevel >1.8</complianceLevel >
95+ <aspectLibraries >
96+ <aspectLibrary >
97+ <groupId >software.amazon.lambda</groupId >
98+ <artifactId >powertools-logging</artifactId >
99+ </aspectLibrary >
100+ <aspectLibrary >
101+ <groupId >software.amazon.lambda</groupId >
102+ <artifactId >powertools-tracing</artifactId >
103+ </aspectLibrary >
104+ <aspectLibrary >
105+ <groupId >software.amazon.lambda</groupId >
106+ <artifactId >powertools-metrics</artifactId >
107+ </aspectLibrary >
108+ </aspectLibraries >
109+ </configuration >
110+ <executions >
111+ <execution >
112+ <goals >
113+ <goal >compile</goal >
114+ </goals >
115+ </execution >
116+ </executions >
117+ </plugin >
118+ ...
119+ </plugins >
120+ </build >
121+ ```
122+ #### gradle
123+
124+ For Java 11+:
125+
126+ ```groovy
127+ plugins {
128+ id 'java'
129+ id 'io.freefair.aspectj.post-compile-weaving' version '8.1.0'
130+ }
131+
132+ repositories {
133+ mavenCentral()
134+ }
135+
136+ dependencies {
137+ aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
138+ aspect 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}'
139+ aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
140+ }
141+
142+ sourceCompatibility = 11
143+ targetCompatibility = 11
144+ ```
145+
146+ For Java8:
147+
148+ ```groovy
149+ plugins {
150+ id 'java'
151+ id 'io.freefair.aspectj.post-compile-weaving' version '6.6.3'
152+ }
153+
154+ repositories {
155+ mavenCentral()
156+ }
157+
158+ dependencies {
159+ aspect 'software.amazon.lambda:powertools-logging:{{ powertools.version }}'
160+ aspect 'software.amazon.lambda:powertools-tracing:{{ powertools.version }}'
161+ aspect 'software.amazon.lambda:powertools-metrics:{{ powertools.version }}'
162+ }
163+
164+ sourceCompatibility = 1.8
165+ targetCompatibility = 1.8
166+ ```
167+
168+
81169## Example
82170
83171See the ** [ examples] ( examples ) ** directory for example projects showcasing usage of different utilities.
0 commit comments