maven-build-cache-extension icon indicating copy to clipboard operation
maven-build-cache-extension copied to clipboard

#211 [core] `Migrate to Java 21`

Open Pankraz76 opened this issue 11 months ago • 4 comments

#211 [core] Migrate to Java 21

  • https://github.com/apache/maven-pmd-plugin/pull/201
  • https://github.com/apache/maven-pmd-plugin/pull/201#issuecomment-2848187270

Following this checklist to help us incorporate your contribution quickly and easily:

  • [ ] Your pull request should address just one issue, without pulling in other changes.
  • [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [ ] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.
  • [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
  • [ ] Run mvn verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • [ ] You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement if you are unsure please ask on the developers list.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004 you have to acknowledge this by using the following check-box.

Pankraz76 avatar May 03 '25 08:05 Pankraz76

I would say I'm a bit sceptical here. What is the added value, except for preventing people stuck with 17, from using the cache?

olamy avatar May 03 '25 09:05 olamy

  • https://github.com/pmd/pmd/pull/5714
  • https://github.com/checkstyle/checkstyle/issues/16981#issuecomment-2841063249

Java 21 brings significant improvements, including enhanced performance, security updates, and new language features like record patterns and string templates.

If we want to push PMD, we need this here.

Security updates are always a good thing.

It's about being up to date and not getting stuck, like you mentioned. It's not mandatory to do right now, but we have to move on sooner or later.

Assuming it's only 17 to 21, the distance is not so big. Of course, it's only my opinion, and you need to verify. But not being outdated is kind of a best practice, so it's just a "when," not an "if," right?

Not to mention vthreads :) We don't necessarily take advantage of this, but 21 was a big step ahead and with new upcoming 24 release the thread pinning issues should be resolved, focusing on performance overall in this update.

So when making update it's either a big bang or small little tasks. It's up to us what impact and risk we incorporate.

Pankraz76 avatar May 03 '25 09:05 Pankraz76

Nobody stops you from using 21 at runtime. What is the point having it at build time?

michael-o avatar May 03 '25 19:05 michael-o

Nobody stops you from using 21 at runtime. What is the point having it at build time?

new language features like record patterns and string templates.

yes the benefit might be small then. Its then even more a low hanging fruit then and worth to align? Im sure you have good reasons, not to do so yet.

As its seems not a big deal, aligning now might be simpler then doing it later on with a bigger version increasing in impact and risk. Until the 21 migration is making changes, I would consider the migration not fully completed.

Pankraz76 avatar May 03 '25 20:05 Pankraz76

@Pankraz76

If we want to push PMD, we need this here.

Can you explain this? You can build/run PMD also with Java 21 without any changes. PMD itself has also not decided yet when to move on from Java 8... so. Not sure what's your motivation here...

adangel avatar May 11 '25 09:05 adangel

@Pankraz76

If we want to push PMD, we need this here.

Can you explain this? You can build/run PMD also with Java 21 without any changes. PMD itself has also not decided yet when to move on from Java 8... so. Not sure what's your motivation here...

Wasting our time.

michael-o avatar May 11 '25 09:05 michael-o

@Pankraz76

If we want to push PMD, we need this here.

Can you explain this? You can build/run PMD also with Java 21 without any changes. PMD itself has also not decided yet when to move on from Java 8... so. Not sure what's your motivation here...

While POC in

  • https://github.com/pmd/pmd/pull/5714

the issue occurred, assuming the migration needed to be done here prior.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-pmd-plugin:3.26.0:pmd (pmd-main) on project pmd-core: Failed to determine whether report can be generated: Unsupported targetJdk value '1.21'. -> [Help 1]

Wasting our time.

yes, as this was ment just as an tryout.

Pankraz76 avatar May 11 '25 14:05 Pankraz76