Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade PMD to 7.0.0 #462

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Upgrade PMD to 7.0.0 #462

merged 2 commits into from
Mar 25, 2024

Conversation

holgerfriedrich
Copy link
Member

Add support for Java 21.

https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes.html


Update to PMD7 gives me some headache, as AST has changed.
See migration guide, https://docs.pmd-code.org/pmd-doc-7.0.0-rc4/pmd_release_notes.html#migration-guide-for-pmd-7

Still struggling to get custom test to work properly (UseSLF4JLoggerRule.java).

@wborn Could use some help, just in case you know the details of AST parsing.....

@holgerfriedrich holgerfriedrich requested a review from a team as a code owner March 1, 2024 17:19
@wborn
Copy link
Member

wborn commented Mar 1, 2024

I had a look and after setting a break point I could check the objects and see where all the required data is stored nowadays.
Then I could get it working again with the changes in holgerfriedrich#1.

@holgerfriedrich
Copy link
Member Author

holgerfriedrich commented Mar 3, 2024

for a benchmark see #463 (comment)

@holgerfriedrich
Copy link
Member Author

holgerfriedrich commented Mar 9, 2024

benchmark looks good, removed label WIP

@holgerfriedrich holgerfriedrich changed the title [WIP] Upgrade PMD to 7.0.0-rc4 Upgrade PMD to 7.0.0-rc4 Mar 9, 2024
@holgerfriedrich
Copy link
Member Author

Hello @openhab/sat-maintainers , kindly asking to review/merge this PR. We need this as one of the last pieces towards a Java21 build. Thanks!

See the comparison of 0.15 and 0.16-SNAPSHOT: #463 (comment)

See comments above:

btw: Once we get #462 and #463, we should release.
The benefit it support for Java 21 (i.e. support for running SAT checks on class files generated with Java 21).

@holgerfriedrich
Copy link
Member Author

@kaikreuzer When I checked a few days ago, it was still -rc4 :-)
I will quickly check if there is a functional difference and pull the final version in.

holgerfriedrich and others added 2 commits March 24, 2024 22:07
Add support for Java 21.

https://docs.pmd-code.org/pmd-doc-7.0.0/pmd_release_notes.html

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Wouter Born <github@maindrain.net>
@holgerfriedrich holgerfriedrich changed the title Upgrade PMD to 7.0.0-rc4 Upgrade PMD to 7.0.0 Mar 24, 2024
@holgerfriedrich
Copy link
Member Author

holgerfriedrich commented Mar 24, 2024

A lot of changes between rc4 and final, I had to adapt a few files.
Though, now the PR is reworked and seems to work fine with the final release.

@wborn do you want to give it a try as well?

btw: The new dependency pmd-compat6 is still needed until maven-pmd-plugin gets updated.

Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still works well for me with these changes! 👍

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you both!

@kaikreuzer kaikreuzer merged commit 27fbb30 into openhab:main Mar 25, 2024
3 checks passed
@kaikreuzer kaikreuzer added this to the 0.16.0 milestone Mar 25, 2024
@holgerfriedrich holgerfriedrich deleted the pr-pmd7 branch March 25, 2024 17:19
@holgerfriedrich
Copy link
Member Author

@kaikreuzer thanks, could you please trigger the release of 0.16?
Not sure how this works and how this gets published on the typical mvn repos....

@kaikreuzer
Copy link
Member

kaikreuzer commented Mar 25, 2024

@holgerfriedrich Will do. Is there any special reason why the build asks for Java 11? Or is it safe to change the constraint and build with with Java 17 instead (which seems to work well)?

@holgerfriedrich
Copy link
Member Author

holgerfriedrich commented Mar 25, 2024

@holgerfriedrich Will do. Is there any special reason why the build asks for Java 11? Or is it safe to change the constraint and build with with Java 17 instead (which seems to work well)?

@kaikreuzer I typically build with newer versions on my local machine. However, the last time we tried to upgrade to 17, we have broken the release build, see #451. Something releated to the unleash plugin.

@kaikreuzer
Copy link
Member

@holgerfriedrich Many thanks for the reminder!
I've built it with Java11 again and here we are: https://github.com/openhab/static-code-analysis/releases/tag/0.16.0

@holgerfriedrich
Copy link
Member Author

@holgerfriedrich Many thanks for the reminder! I've built it with Java11 again and here we are: https://github.com/openhab/static-code-analysis/releases/tag/0.16.0

Thanks a lot, @kaikreuzer 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants