XChart icon indicating copy to clipboard operation
XChart copied to clipboard

CI with Java 8

Open mccartney opened this issue 1 year ago • 6 comments

  • The project claims compatibility with Java 8.
  • Yet our only CI in PRs executes against Java 11: https://github.com/knowm/XChart/blob/develop/.github/workflows/maven_on_pull_request.yml#L20 Thus we risk bringing in something which won't work with Java 8.

I suggest to add CI check using Java 8.

mccartney avatar May 26 '23 20:05 mccartney

The good thing is that current develop seems to pass with Java 8 when tested locally.

EDIT: actually code formatting fails:

[ERROR] Failed to execute goal com.spotify.fmt:fmt-maven-plugin:2.19:format (default) on project xchart-parent: Execution default of goal com.spotify.fmt:fmt-maven-plugin:2.19:format failed: Unable to load the mojo 'format' in the plugin 'com.spotify.fmt:fmt-maven-plugin:2.19' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com/spotify/fmt/FMT has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.spotify.fmt:fmt-maven-plugin:2.19

But still - maybe the library works in Java 8, just some dev tool for code formatting doesn't.

mccartney avatar May 26 '23 20:05 mccartney

From https://github.com/spotify/fmt-maven-plugin#using-with-java-8

Using with Java 8 Starting from version 1.8, Google Java Formatter requires Java 11 to run. Incidently, all versions of this plugin starting from 2.10 inclusively also require this Java version to properly function. The 2.9.x release branch is the most up-to-date version that still runs on Java 8.

mccartney avatar May 28 '23 19:05 mccartney

yes, we should add a CI check using Java 8. Also yes, I recall the constraint on the formatter. Maybe we just leave it at 2.9.x.

timmolter avatar Jun 04 '23 16:06 timmolter

Yeah. Downgrading to 2.9.1 of the format plugin adds a lot of changes like image (99 files)

mccartney avatar Jun 04 '23 19:06 mccartney

Currently I am thinking about:

  • sticking with Java 8 as the library dependency
  • using the latest of the format plugin
  • making the CI run in two modes: Java 11 (as is) and Java 8 (which would use Java 11 to build and just Java 8 to run tests).

mccartney avatar Jun 04 '23 19:06 mccartney

The main point of the formatter is to have a standard where all committers use so that merge diffs are best readable. That's really the only reason. We can remove all the author comments as well.

timmolter avatar Jun 05 '23 07:06 timmolter