takari / polyglot-maven

Support alternative markup for Apache Maven POM files
Eclipse Public License 1.0
893 stars 101 forks source link

Bump io.takari:takari from 51 to 55 #303

Open cstamas opened 6 months ago

cstamas commented 6 months ago

This involves full reformat of the sources using spotless maven pluging. If this commit enters master, it MUST be followed by another one that sets this commit hash as "git blame ignore".

Changes:

Fixes #262 implicitly, by a minor cleanup among deps

cstamas commented 6 months ago

@lefou @headius WDYT?

lefou commented 6 months ago

Lets wait for CI. I suspect removed support for Java 8.

cstamas commented 6 months ago

Yes, spotless-maven-plugin is 11+ so it needed Java 8 hacks (to NOT run)

lefou commented 6 months ago

I think spotless can also format Scala code, but I have no idea how to enable it. If it is based on scalafmt, I can provide a reasonable scalafmt.conf though.

cstamas commented 6 months ago

So, this is the "price" of latest Takari parent POM: spotless (palantir) formatted source code, and build will fail if unformatted code is being built: to reformat mvn spotless:apply (but you need Java 11+).

cstamas commented 6 months ago

Personally I love this format, whole Maven 3.9 and 4 and all plugins went to this source format as well. POM are formatted as well (element order BUT NOT like "sortpom" that is very bad idea, as dep ordering DOES MATTER).

lefou commented 6 months ago

So, this is the "price" of latest Takari parent POM: spotless (palantir) formatted source code, and build will fail if unformatted code is being built: to reformat mvn spotless:apply (but you need Java 11+).

Sounds good to me. Formatted code makes maintenance and PR management easier!

cstamas commented 6 months ago

Lets give some time to @headius and others to chime in...

lefou commented 6 months ago

If you want to enable spotless for scala files, you could use this config file.

cstamas commented 6 months ago

@lefou done, pls review

headius commented 6 months ago

Worth it for fixing 2-space indent on all the Java files alone. 👍

cstamas commented 6 months ago

Now, Java, Scala and Kotlin sources are formatted. Will let this PR one more day (to get possible feedback from any interested party) and will merge after.

cstamas commented 4 months ago

Updated PR to parent 55. Not merging yet to not stir things with polyglot-ruby, let's see is their issue fixed for start, and then will continue on this path.

cstamas commented 4 months ago

@lefou can you remind me... AFAIR, you insist on Java 8 build time... Due that we are stuck on Takari Lifecycle 2.0.x (as 2.1.x lifts build time requirement to Java 11, but still can produce Java 8 bytecode).

Latest Takari Lifecycle brings among other things updated GPG signing, so this "hack" by involving maven-gpg-plugin would become unnecessary as well. Just to be clear, build time we could use Java 11+ (like a matrix of 11, 17, 21, without 8 as today), but the artifacts produced would still be Java 8 bytecode. Simply put "build time Java requirement" would be raised to Java 11.

So, do you still insist on Java 8 build time?

lefou commented 4 months ago

@lefou can you remind me... AFAIR, you insist on Java 8 build time... Due that we are stuck on Takari Lifecycle 2.0.x (as 2.1.x lifts build time requirement to Java 11, but still can produce Java 8 bytecode).

Most discussion happened in https://github.com/takari/polyglot-maven/pull/257.

In summary. I'm not against dropping Java 8 build time. But since the Scala dialect supports Java 8 runtime, we also should maintain a usable integration test suite. IIUC, if we drop Java 8 build time, we can no longer run Java 8 integration tests unless we add some toolchain setup, which isn't trivial and beyond my maintenance resources.

Latest Takari Lifecycle brings among other things updated GPG signing, so this "hack" by involving maven-gpg-plugin would become unnecessary as well. Just to be clear, build time we could use Java 11+ (like a matrix of 11, 17, 21, without 8 as today), but the artifacts produced would still be Java 8 bytecode. Simply put "build time Java requirement" would be raised to Java 11.

So, do you still insist on Java 8 build time?

No.

So, if we drop Java 8 build time support, we better also drop Java 8 runtime support for the Scala dialect due to a missing test setup. Or someone contributes an integration test setup for Java 8.

Supporting an untested product is pure evil. There is no way to reproduce issues anymore.

cstamas commented 1 week ago

Ok, all interested folks, I am about to "revive" this PR. It will imply also moving to Java 11 or maybe even Java 17 to build (as takari lifecycle is Java 11, and about to move to 17).

Still, will try to set up ITs/UTs run on Java 8 w/ similar setup as on MIMA https://github.com/maveniverse/mima (as explained here: https://cstamas.org/blog/2024/09/very-simple-ci-setup/)

mosabua commented 1 week ago

I am good with moving to 11 and also 17 .. probably not newer than that for this project though.

And yes .. we should completely drop for Java 8 - build and runtime. And if we go for 17 .. we would also drop build and runtime with any < 16

headius commented 1 week ago

JRuby 9.4.x will continue to be supported until 2026 at least, and it builds on Java 8 with polyglot-maven. Removing runtime support going forward would mean one of two things:

JRuby 10, due out early in 2025, will move to Java 17 or 21 minimum, so the problem will go away... but not for at least another year after that, and probably more like two (9.4 is a well-established release line and we predict users will drag their feet beyond the 2026 EOL).

cstamas commented 1 week ago

No, you misunderstood me: I plan to move takari-lifecycle to Java 17 (see https://github.com/takari/takari-lifecycle/pull/194). That will mean that we should move building of polyglot to Java17 as well (as I want to move past stale lifecycle used here). OTOH, we can and still should produce Java8 bytecode, and I do plan to do it.

But, this comes at cost, that we need split "build" vs "tests" (as in ITs), that is somewhat started by me here: https://github.com/takari/polyglot-maven/pull/341

cstamas commented 1 week ago

So the goal is to build + UT on Java 17 or 21, and then have the IT suite run on matrix that includes Java 8 as well. Sadly, not all polyglot modules have real ITs, so unsure what to do there...

headius commented 1 week ago

@cstamas Ok, then I'm on board. As long as polyglot still supports the use of Java 8 at runtime (build time for a polyglot-using project) then we will not be affected.

cstamas commented 1 week ago

Right, this is only about building polyglot, but the built polyglot itself remains Java 8, as it was. This is merely for "tooling" as takari-lifecycle is already at Java 11, but latest Eclipse JDT update will push it toward Java 17, and polyglot uses really old release of takari-lifecycle