Jitpack failing a build with Misconfigured Toolchain

925 views Asked by At

I am trying to compile a forked repo with jitpack becaause the repo is not published to maven and has several bugfixes over its prior release that is published on maven. However, I keep getting a misconfigured toolchain error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project microbean-kubernetes-controller: Misconfigured toolchains. Non-existing JDK home configuration at /usr/lib/jvm/java-6-oracle -> [Help 1]

I've been at this for a few hours now, and I have basically given up.

The repo is at: https://github.com/asuprem/microbean-kubernetes-controller

The pom.xml is at: https://github.com/asuprem/microbean-kubernetes-controller/blob/master/pom.xml

The build log for jitpack is at: https://jitpack.io/com/github/asuprem/microbean-kubernetes-controller/v0.2.3.3/build.log

I am specifically getting the following error:

[INFO] Required toolchain: jdk [ version='1.8' ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.134 s
[INFO] Finished at: 2020-10-20T20:06:17Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project microbean-kubernetes-controller: Misconfigured toolchains. Non-existing JDK home configuration at /usr/lib/jvm/java-6-oracle -> [Help 1]

I thought this was because the original repo did not specify a maven-compiler-plugin so I added the following to the pom:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.2</version>
  <configuration>
    <source>1.8</source>
    <target>1.8</target>
  </configuration>
</plugin>

It does compile locally though.

I also tried adding a jitpack.yml with:

jdk:
  - openjdk8

because I thought the error was the usr/lib/jvm/java-6-oracle bit, but that also failed, so I removed it.

I know I am missing something probably incredibly simple, but staring at the logs isn't helping anymore. Any help would be greatly appreciated.

1

There are 1 answers

0
RocketMan On

I ran into this same error. It turns out my toolchains.xml file, which maven was reading when trying to locate the appropriate JDK for the toolchain, was invalid - it had an entry for <jdkHome> that pointed to a location that did not exist.

The solution was to simply correct the incorrect path in my toolchains.xml file and then everything worked just fine.