Skip to content

Commit

Permalink
Ensure Jitpack compatibility
Browse files Browse the repository at this point in the history
By default Jitpack builds with Java 11.0.2 and Maven 3.6.1.
Additionally, its read-only `/script/toolchains.xml` file points to at
least one nonexistent JDK home directory. See jitpack/jitpack.io#5795.

These days Error Prone releases are built using JDK 17 and require at
least Maven 3.6.3. Additionally, its `maven-toolchains-plugin`
configuration rejects invalid `toolchains.xml` configurations.

As such this change uses SDKMAN! to configure recent Java and Maven
versions, and modifies the build by disabling Maven Toolchains usage.
  • Loading branch information
Stephan202 committed Oct 26, 2024
1 parent ff3d929 commit a4e3306
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
8 changes: 8 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
before_install:
- mvn -version
- source "${HOME}/.sdkman/bin/sdkman-init.sh"
- sdk update
- sdk install java 17.0.12-tem
- sdk use java 17.0.12-tem
- sdk install maven 3.9.9
- sdk use maven 3.9.9
20 changes: 0 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<jdkToolchain>
<!--
Test against the current default JDK, not the latest JDK a toolchain is registered for.
On Error Prone's CI, the JDK we want to run the tests against is installed last, to
make it the default on the PATH and for JAVA_HOME:
https://github.com/google/error-prone/blob/master/.github/workflows/ci.yml
See also Guava's similar logic here:
https://github.com/google/guava/blob/781068569f0a275ac3c4bce08c9a1fe4d624048a/pom.xml#L20
-->
<version>${java.specification.version}</version>
</jdkToolchain>
<argLine>
-Xmx1g
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
Expand Down Expand Up @@ -289,13 +276,6 @@
</jdk>
</toolchains>
</configuration>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit a4e3306

Please sign in to comment.