Skip to content

Add basic Github workflow for CI (initially for Java 8, 11) #74

Closed

Description

@garretwilson

I'm trying to build a fork of the master branch of ClassMate using OpenJDK 17 on Windows and Maven 3.9.4. I do a simple:

mvn verify

I get:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project classmate: Compilation failure: Compilation failure:
[ERROR] Source option 6 is no longer supported. Use 7 or later.
[ERROR] Target option 6 is no longer supported. Use 7 or later.

As v3.8.1 is a pretty old version of the Maven compiler plugin (probably inherited from com.fasterxml:oss-parent:43), I would guess that the issue here is my Java 17; it probably doesn't support Java 6—which was released almost 20 years ago!

Just for "fun" I switched to Java 7:

<version.jdk>7</version.jdk>

This gives me all sorts of new errors:

[ERROR] Failures: 
[ERROR]   TestMemberResolver.testAddOverridesFromInterfaces:292 expected:<4> but was:<6>
[ERROR]   TestTypeDescriptions.testSimpleTypes:38 expected:<...va.lang.CharSequence[]> but was:<...va.lang.CharSequence[,java.lang.constant.Constable,java.lang.constant.ConstantDesc]>
[ERROR]   ResolvedObjectTypeTest.testGetStaticFields:81 Expected 3 (JDK 1.6), 4 (1.7/1.8) or 6 (1.9) static fields, got 7; fields: [serialVersionUID, COMPACT_STRINGS, serialPersistentFields, REPL, CASE_INSENSITIVE_ORDER, LATIN1, UTF16]

I'm guessing these are unit tests that fail under Java 7 for whatever reason (assuming they weren't failing for you already on Java 6—I have no way to know without (gasp!) downgrading my JDK. 😄).

Basically the feeling I'm getting is that someone needs to go into the library and just bring it up-to-speed to some modern Java version—update the plugins, fix the unit tests, etc. I could help do that, but only if you say it's OK to move off Java 6. I don't know your feelings about that.

I know as an open-source library maintainer it's easy to think, "oh, I don't want to keep anyone from using my library", and I've had those feelings many times as well. But I think there's a limit and we need to encourage going forward with Java. I would recommend Java 11 at the minimum, but I could work on this if you could at least bear switching to Java 8. I think Java 7 and below would just be too much pain for me without any realistic gain.

Activity

  1. changed the title [-]Modernize Java support ("cannot build `master` branch with Java 17").[/-] [+]Modernize Java support (e.g. cannot build `master` branch with Java 17).[/+] on Oct 5, 2023
  2. cowtowncoder commented on Oct 5, 2023

    @cowtowncoder
    Member

    Ok this is unexpected, at least wrt Java 7. As far as I recall things were working with Java 6. And I thought I had actually added Github workflow for running unit tests with matrix build... but not so.

    So it definitely sounds like I need to find time to set up modern scaffolding for things, including Maven wrapper as well. Can probably copy much of it from, say, jackson-core.

  3. added a commit that references this issue on Oct 10, 2023
  4. cowtowncoder commented on Oct 10, 2023

    @cowtowncoder
    Member

    Ok, initial parts done; there's now CI for Java 8 and 11, with Maven wrapper.

  5. changed the title [-]Modernize Java support (e.g. cannot build `master` branch with Java 17).[/-] [+]Add basic Github workflow for CI (initially for Java 8, 11)[/+] on Oct 10, 2023
  6. cowtowncoder commented on Oct 10, 2023

    @cowtowncoder
    Member

    Actually need to do #75 to enable JDK 17+ support; closing this as complete.

  7. garretwilson commented on Oct 19, 2023

    @garretwilson
    Author

    Just circling back to say I'm able to build the project now. Thank you very much.

  8. cowtowncoder commented on Oct 19, 2023

    @cowtowncoder
    Member

    @garretwilson No problem; these should already have existed. But better late than never. After getting Jackson 2.16.0-rc1 out (soon) I'll take care of Java 8 upgrade issue, version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions