Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions aws-lambda-java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<toolchains>
<jdk>
<!-- Range matches both "8" (e.g. actions/setup-java)
and "1.8" (legacy / hand-written toolchains). -->
<version>[1.8,9)</version>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>dev</id>
Expand Down
21 changes: 21 additions & 0 deletions aws-lambda-java-events-sdk-transformer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<toolchains>
<jdk>
<!-- Range matches both "8" (e.g. actions/setup-java)
and "1.8" (legacy / hand-written toolchains). -->
<version>[1.8,9)</version>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
Expand Down
26 changes: 26 additions & 0 deletions aws-lambda-java-events/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,32 @@
<junit-jupiter.version>5.12.2</junit-jupiter.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<toolchains>
<jdk>
<!-- Range matches both "8" (e.g. actions/setup-java)
and "1.8" (legacy / hand-written toolchains). -->
<version>[1.8,9)</version>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Comment on lines +45 to +70

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: i see this is repeated across all the pom files, is it worth considering having a shared parent pom and have all the common stuff in there?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have considered this. it might make sense when we automate the deployment, but for now each module is independently versioned and released to Maven Central and the CI builds them in isolation. a parent POM introduces coupling (any parent change needs to be published to maven central before any child module can be released). for this PR it feels safer to keep the modules self contained

<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
Expand Down
21 changes: 21 additions & 0 deletions aws-lambda-java-runtime-interface-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,27 @@
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<toolchains>
<jdk>
<!-- Range matches both "8" (e.g. actions/setup-java)
and "1.8" (legacy / hand-written toolchains). -->
<version>[1.8,9)</version>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ COPY --from=docker/buildx-bin:latest /buildx /usr/libexec/docker/cli-plugins/doc
ENV PATH="$PATH:/apache-maven/bin"
RUN mkdir /apache-maven && \
curl https://archive.apache.org/dist/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz | \
tar -xz -C /apache-maven --strip-components 1
tar -xz -C /apache-maven --strip-components 1

# Declare JDK 8 in toolchains.xml so maven-toolchains-plugin can resolve it
RUN mkdir -p /root/.m2 && \
printf '<?xml version="1.0" encoding="UTF-8"?>\n<toolchains>\n <toolchain>\n <type>jdk</type>\n <provides>\n <version>8</version>\n </provides>\n <configuration>\n <jdkHome>/usr/lib/jvm/java-1.8.0-amazon-corretto</jdkHome>\n </configuration>\n </toolchain>\n</toolchains>\n' > /root/.m2/toolchains.xml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two points:

  1. Minor nit -> hardcoding the jdkHome path -> Unlikely, but possible that base image changes where it installs Corretto 8 (different version suffix or directory). Then this would break as the path won't resolve - is there a better way to ensure coupling?

  2. Readability of the printf line -> You can use a heredoc (<<) instead of a one-line unformatted xml string. That way the xml would appear properly formatted

Functionally, everything looks okay though

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd create a file and do a copy instead of print if, that is better for maintainability

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also let's add an example tollchains.xml (toolchains.xml.example) for contributors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benrkia I suggested a heredoc for readability instead of having a separate file + copy as it's only 10 lines of xml. What do you think?

@fabisev fabisev Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd create a file and do a copy instead of print if, that is better for maintainability

I believe that his Dockerfile is built via stdin (

.PHONY: setup-codebuild-agent
setup-codebuild-agent:
	docker build -t codebuild-agent \
	 --build-arg ARCHITECTURE=$(ARCHITECTURE_ALIAS) \
	  - < test/integration/codebuild-local/Dockerfile.agent

in the Makefile), which means there is no build context to COPY for local files won't work. we would need to refactor the Makefile to use -f with a build context directory to enable that.

right now i have switched to a heredoc with ${JAVA_HOME}, but happy to do the Makefile refactor if you think it would be nicer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that but let's add an example file and mention that in contribution.md so that people don't get failure because toolchain definition is missing

21 changes: 21 additions & 0 deletions aws-lambda-java-serialization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,27 @@
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<toolchains>
<jdk>
<!-- Range matches both "8" (e.g. actions/setup-java)
and "1.8" (legacy / hand-written toolchains). -->
<version>[1.8,9)</version>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
21 changes: 21 additions & 0 deletions aws-lambda-java-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,27 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<toolchains>
<jdk>
<!-- Range matches both "8" (e.g. actions/setup-java)
and "1.8" (legacy / hand-written toolchains). -->
<version>[1.8,9)</version>
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down
Loading