-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document which toolchains must be listed in ~/.m2/toolchains.xml
to build locally
#4823
Comments
Update: I created the following <?xml version="1.0" encoding="UTF-8"?>
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<toolchain>
<type>jdk</type>
<provides>
<version>21</version>
</provides>
<configuration>
<jdkHome>/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home</jdkHome>
</configuration>
</toolchain>
<toolchain>
<type>jdk</type>
<provides>
<version>25</version>
</provides>
<configuration>
<jdkHome>/Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home</jdkHome>
</configuration>
</toolchain>
</toolchains> Here is my JDK 25 version:
With the above, if I run
If I edit the top-level diff --git a/pom.xml b/pom.xml
index ac716fb30..c500f45b4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -302,7 +302,7 @@
<configuration>
<toolchains>
<jdk>
- <version>25</version>
+ <version>21</version>
</jdk>
</toolchains>
</configuration> Then, |
Ok, I figured it out I think. If I also add a Java 17 JDK to the |
~/.m2/toolchains.xml
to build locally
Sorry you had to figure this out the hard way, we should definitely document it somewhere. Maybe the wiki, perhaps in https://github.com/google/error-prone/wiki/For-Developers ? If you want to propose something I will add it there, or I will try to find time to write it up. |
A possible source of confusion is how m-toolchains-p matches versions. For example, I have
which does not satisfy the constraint <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<jdkToolchain>
<version>${java.specification.version}</version>
</jdkToolchain> when <jdkToolchain>
<version>[${java.specification.version},${java.version}]</version>
</jdkToolchain> would be satisfied (there are other constraints in other locations). It would not save a user from having to maintain a It would seem like plain (Of course, the toolchains file is static whereas users will probably tend to have transparently updating implementations, so |
@cushon I wrote up some instructions here: msridhar/error-prone-wiki@607ab10 It would be cool if we could re-configure the |
Thanks @msridhar! I added that to the wiki. Adjusting the versions constraints to be more compatible with |
On a Mac when I run
mvn clean verify
on the latest master branch I get an error:I tried changing the value in
pom.xml
to 23 or 21 (both of which I have installed) but I got a similar error. I also ranmvn toolchains:generate-jdk-toolchains-xml -Dtoolchain.file=~/.m2/toolchains.xml
to try to generate thetoolchains.xml
file but still got the same error.Are there docs somewhere on steps required to build locally and properly specify the toolchains? Thanks!
The text was updated successfully, but these errors were encountered: