@@ -13,31 +13,32 @@ Powertools for AWS Lambda (Java) is a developer toolkit to implement Serverless
13
13
14
14
Powertools for AWS Lambda (Java) is available in Maven Central. You can use your favourite dependency management tool to install it
15
15
16
- * [ maven ] ( https://maven.apache.org/ ) :
16
+ #### Maven :
17
17
``` xml
18
18
<dependencies >
19
19
...
20
20
<dependency >
21
21
<groupId >software.amazon.lambda</groupId >
22
22
<artifactId >powertools-tracing</artifactId >
23
- <version >1.17.0-SNAPSHOT </version >
23
+ <version >1.16.0 </version >
24
24
</dependency >
25
25
<dependency >
26
26
<groupId >software.amazon.lambda</groupId >
27
27
<artifactId >powertools-logging</artifactId >
28
- <version >1.17.0-SNAPSHOT </version >
28
+ <version >1.16.0 </version >
29
29
</dependency >
30
30
<dependency >
31
31
<groupId >software.amazon.lambda</groupId >
32
32
<artifactId >powertools-metrics</artifactId >
33
- <version >1.17.0-SNAPSHOT </version >
33
+ <version >1.16.0 </version >
34
34
</dependency >
35
35
...
36
36
</dependencies >
37
37
```
38
38
39
39
And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambda-powertools-java aspects into your project:
40
40
41
+ For Java 11+, use the following:
41
42
``` xml
42
43
<build >
43
44
<plugins >
@@ -78,6 +79,93 @@ And configure the aspectj-maven-plugin to compile-time weave (CTW) the aws-lambd
78
79
</build >
79
80
```
80
81
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
+
81
169
## Example
82
170
83
171
See the ** [ examples] ( examples ) ** directory for example projects showcasing usage of different utilities.
0 commit comments