Skip to content

Commit 3bdc951

Browse files
committed
docs: Add toolchains.xml example and setup guide
1 parent 8a3267a commit 3bdc951

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,25 @@ To send us a pull request, please:
3636
5. Send us a pull request, answering any default questions in the pull request interface.
3737
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3838

39+
40+
## Build Prerequisites
41+
42+
This project uses the Maven Toolchains Plugin to pin compilation to JDK 8. If you don't have a `~/.m2/toolchains.xml` configured, builds will fail with:
43+
44+
```
45+
No toolchain found for type jdk [ version='[1.8,9)' ]
46+
```
47+
48+
To fix this, copy the example file to your Maven config directory and update the path:
49+
50+
```bash
51+
cp toolchains.xml.example ~/.m2/toolchains.xml
52+
```
53+
54+
Then edit `~/.m2/toolchains.xml` and set `<jdkHome>` to your local JDK 8 installation path.
55+
56+
Note: if you use `actions/setup-java` in CI (as our GitHub Actions workflows do), this file is generated automatically.
57+
3958
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4059
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4160

‎toolchains.xml.example‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Maven Toolchains configuration for aws-lambda-java-libs.
4+
5+
This file tells Maven where to find JDK 8, which is required by the
6+
maven-toolchains-plugin configured in each module's pom.xml.
7+
8+
To use: copy this file to ~/.m2/toolchains.xml and set the jdkHome
9+
path to match your local JDK 8 installation.
10+
-->
11+
<toolchains>
12+
<toolchain>
13+
<type>jdk</type>
14+
<provides>
15+
<version>8</version>
16+
</provides>
17+
<configuration>
18+
<jdkHome>/path/to/your/jdk8</jdkHome>
19+
</configuration>
20+
</toolchain>
21+
</toolchains>

0 commit comments

Comments
 (0)