Skip to content

Commit cf1f9f3

Browse files
committed
fix: install events using Java 8
1 parent 5609b1b commit cf1f9f3

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/samples.yml

+24-5
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,37 @@ jobs:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- uses: actions/checkout@v4
43-
- uses: actions/setup-java@v4
43+
# Set up both Java 8 and 21
44+
- name: Set up Java 8 and 21
45+
uses: actions/setup-java@v4
4446
with:
45-
java-version: 21
47+
java-version: |
48+
8
49+
21
4650
distribution: corretto
4751

48-
# Install events module
52+
# Check Java versions
53+
- name: Verify Java installations
54+
run: |
55+
echo "Default Java version:"
56+
java -version
57+
echo "JAVA_HOME=$JAVA_HOME"
58+
59+
# Install events module using Java 8
4960
- name: Install events with Maven
5061
run: |
62+
export JAVA_HOME=$JAVA_HOME_8_X64
5163
mvn -B clean install \
52-
-P release \
64+
-Dmaven.compiler.source=1.8 \
65+
-Dmaven.compiler.target=1.8 \
66+
-Dmaven.compiler.forceJavacCompilerUse=true \
67+
-Dmaven.compiler.plugin.version=3.5.1 \
5368
--file aws-lambda-java-events/pom.xml
69+
70+
# Switch back to Java 21 for the rest of the build
71+
- name: Set JAVA_HOME back to Java 21
72+
run: export JAVA_HOME=$JAVA_HOME_21_X64
73+
5474
# Build custom-serialization samples
5575
- name: install sam
5676
uses: aws-actions/setup-sam@v2
@@ -64,4 +84,3 @@ jobs:
6484
run: cd samples/custom-serialization/moshi && sam build && sam local invoke -e events/event.json | grep 200
6585
- name: test request-stream-handler
6686
run: cd samples/custom-serialization/request-stream-handler && sam build && sam local invoke -e events/event.json | grep 200
67-

0 commit comments

Comments
 (0)