Skip to content

Commit 1901fac

Browse files
committed
build: Pin compilation to JDK 8 via Maven Toolchains
1 parent 8adb3d7 commit 1901fac

6 files changed

Lines changed: 136 additions & 0 deletions

File tree

  • aws-lambda-java-core
  • aws-lambda-java-events-sdk-transformer
  • aws-lambda-java-events
  • aws-lambda-java-runtime-interface-client
  • aws-lambda-java-serialization
  • aws-lambda-java-tests

aws-lambda-java-core/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,32 @@
3636
<maven.compiler.target>1.8</maven.compiler.target>
3737
</properties>
3838

39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.maven.plugins</groupId>
43+
<artifactId>maven-toolchains-plugin</artifactId>
44+
<version>3.2.0</version>
45+
<configuration>
46+
<toolchains>
47+
<jdk>
48+
<!-- Range matches both "8" (e.g. actions/setup-java)
49+
and "1.8" (legacy / hand-written toolchains). -->
50+
<version>[1.8,9)</version>
51+
</jdk>
52+
</toolchains>
53+
</configuration>
54+
<executions>
55+
<execution>
56+
<goals>
57+
<goal>toolchain</goal>
58+
</goals>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
3965
<profiles>
4066
<profile>
4167
<id>dev</id>

aws-lambda-java-events-sdk-transformer/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,27 @@
7979

8080
<build>
8181
<plugins>
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-toolchains-plugin</artifactId>
85+
<version>3.2.0</version>
86+
<configuration>
87+
<toolchains>
88+
<jdk>
89+
<!-- Range matches both "8" (e.g. actions/setup-java)
90+
and "1.8" (legacy / hand-written toolchains). -->
91+
<version>[1.8,9)</version>
92+
</jdk>
93+
</toolchains>
94+
</configuration>
95+
<executions>
96+
<execution>
97+
<goals>
98+
<goal>toolchain</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
</plugin>
82103
<plugin>
83104
<artifactId>maven-surefire-plugin</artifactId>
84105
<version>${maven-surefire-plugin.version}</version>

aws-lambda-java-events/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,32 @@
4242
<junit-jupiter.version>5.12.2</junit-jupiter.version>
4343
</properties>
4444

45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.apache.maven.plugins</groupId>
49+
<artifactId>maven-toolchains-plugin</artifactId>
50+
<version>3.2.0</version>
51+
<configuration>
52+
<toolchains>
53+
<jdk>
54+
<!-- Range matches both "8" (e.g. actions/setup-java)
55+
and "1.8" (legacy / hand-written toolchains). -->
56+
<version>[1.8,9)</version>
57+
</jdk>
58+
</toolchains>
59+
</configuration>
60+
<executions>
61+
<execution>
62+
<goals>
63+
<goal>toolchain</goal>
64+
</goals>
65+
</execution>
66+
</executions>
67+
</plugin>
68+
</plugins>
69+
</build>
70+
4571
<distributionManagement>
4672
<repository>
4773
<id>sonatype-nexus-staging</id>

aws-lambda-java-runtime-interface-client/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,27 @@
115115
</extension>
116116
</extensions>
117117
<plugins>
118+
<plugin>
119+
<groupId>org.apache.maven.plugins</groupId>
120+
<artifactId>maven-toolchains-plugin</artifactId>
121+
<version>3.2.0</version>
122+
<configuration>
123+
<toolchains>
124+
<jdk>
125+
<!-- Range matches both "8" (e.g. actions/setup-java)
126+
and "1.8" (legacy / hand-written toolchains). -->
127+
<version>[1.8,9)</version>
128+
</jdk>
129+
</toolchains>
130+
</configuration>
131+
<executions>
132+
<execution>
133+
<goals>
134+
<goal>toolchain</goal>
135+
</goals>
136+
</execution>
137+
</executions>
138+
</plugin>
118139
<plugin>
119140
<artifactId>maven-install-plugin</artifactId>
120141
<groupId>org.apache.maven.plugins</groupId>

aws-lambda-java-serialization/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,27 @@
191191
</extension>
192192
</extensions>
193193
<plugins>
194+
<plugin>
195+
<groupId>org.apache.maven.plugins</groupId>
196+
<artifactId>maven-toolchains-plugin</artifactId>
197+
<version>3.2.0</version>
198+
<configuration>
199+
<toolchains>
200+
<jdk>
201+
<!-- Range matches both "8" (e.g. actions/setup-java)
202+
and "1.8" (legacy / hand-written toolchains). -->
203+
<version>[1.8,9)</version>
204+
</jdk>
205+
</toolchains>
206+
</configuration>
207+
<executions>
208+
<execution>
209+
<goals>
210+
<goal>toolchain</goal>
211+
</goals>
212+
</execution>
213+
</executions>
214+
</plugin>
194215
<plugin>
195216
<groupId>org.apache.maven.plugins</groupId>
196217
<artifactId>maven-shade-plugin</artifactId>

aws-lambda-java-tests/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,27 @@
245245

246246
<build>
247247
<plugins>
248+
<plugin>
249+
<groupId>org.apache.maven.plugins</groupId>
250+
<artifactId>maven-toolchains-plugin</artifactId>
251+
<version>3.2.0</version>
252+
<configuration>
253+
<toolchains>
254+
<jdk>
255+
<!-- Range matches both "8" (e.g. actions/setup-java)
256+
and "1.8" (legacy / hand-written toolchains). -->
257+
<version>[1.8,9)</version>
258+
</jdk>
259+
</toolchains>
260+
</configuration>
261+
<executions>
262+
<execution>
263+
<goals>
264+
<goal>toolchain</goal>
265+
</goals>
266+
</execution>
267+
</executions>
268+
</plugin>
248269
<plugin>
249270
<groupId>org.apache.maven.plugins</groupId>
250271
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)