Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: 2.18.0 removed toolchains-sample-*.xml, 2.19.0 shifted to ./workflows/maven-toolchains.xml

...

version='[9, )' means the build process needs access to JDK >=9. You don't need to install JDK 9. Its possible to register a JDK version that satisfies the toolchain requirement, i.e. JDK 11, without having to make changes to machine's default JDK by using Toolchains. In addition to the sample toolchain files that ship with log4j (toolchains-dockerUp to release 2.18.0 log4j shipped with several toolchain files: toolchains-sample-linux.xml, toolchains-jenkinssample-ubuntumac.xml, toolchains-jenkinssample-win.xml, toolchains-sample-linux.xml, toolchains-sample-mac.xml, toolchains-sample-win.xml) here is a minimal JDK 11 example. In release 2.19.0 (LOG4J2-3573, LOG4J2-3520) those have files have been condensed/moved to a single file (./workflows/maven-toolchains.xml) that now relies on two environment variables:

Code Block
languagexml
titleMinimal JDK 11 Toolchains file for Windows./workflows/maven-toolchains.xml
collapsetrue
<toolchains>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>11<<version>1.8</version>
      <vendor>sun</vendor></provides>
    <configuration>
      <jdkHome>${env.JAVA_HOME_8_X64}</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>11</version>
    </provides>
    <configuration>
      <jdkHome>C:\Program Files\Java\jdk-11<<jdkHome>${env.JAVA_HOME_11_X64}</jdkHome>
    </configuration>
  </toolchain>
</toolchains>

Now Maven can be invoked using "mvn clean install -t toolchains-sample-win.xml" or the JDK 11 example can be copied to a new file and ran with "mvn clean install -t toolchains-jdk11-win./workflows/maven-toolchains.xml".

mvn apache-rat:check -DskipTests

...