Skip to content

Upgrade Java to 21#3

Open
onsabdulkalam wants to merge 6 commits into
mainfrom
CN-12-OnlyJava21
Open

Upgrade Java to 21#3
onsabdulkalam wants to merge 6 commits into
mainfrom
CN-12-OnlyJava21

Conversation

@onsabdulkalam
Copy link
Copy Markdown

Has the POM been updated?

Yes
The pom.xml file project.version must be bumped appropriately on any code changes.
done

  • the POM has been updated with an appropriate version bump if required

Motivation and Context

Upgrade Java 17 to. 21

What has changed

pom.xml
Only version change

no

no test - ensure the build. is success. without any errors

How to test?

service up in running without any errors

Links

https://officefornationalstatistics.atlassian.net/browse/CN-12

Screenshots (if appropriate):

@onsabdulkalam onsabdulkalam requested a review from a team as a code owner May 11, 2026 09:23
@onsabdulkalam onsabdulkalam added patch A non-feature change, e.g. bug or issue fix do not merge Do not merge this pull request labels May 11, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ MARKDOWN markdownlint 1 0 0 0.31s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Comment thread pom.xml
Comment on lines +113 to +122
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<googleJavaFormat>
<version>1.22.0</version> <!-- Java 21 compatible -->
</googleJavaFormat>
</java>
</configuration>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the reason to replace this with the spotless one?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Up to you since you know more Java than me but I can see that the old formatter does support Java 21. All you need to do is change the group id to com.spotify.fmt and update the version then.

Comment thread pom.xml
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.8</version>
<groupId>com.diffplug.spotless</groupId>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't see this being run in the code. If I change the goal to check then it does work so I'm wondering if the apply needs to be configured to a certain phase.

Comment thread pom.xml
Comment on lines 123 to 129
<executions>
<execution>
<goals>
<goal>format</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This currently ran at the end of the build and just runs a check. The previous one reformatted files as well. If you change the execution to this

<executions>
  <execution>
    <goals>
      <goal>apply</goal>
    </goals>
    <phase>process-sources</phase>
  </execution>
</executions>

It should work similar to what it was like before

Copy link
Copy Markdown
Contributor

@ryangrundy7 ryangrundy7 left a comment

Choose a reason for hiding this comment

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

If you're changing the formatter, you'll need to update the make check command in the Makefile as it was using the old formatter. Just needs to be the spotless:check command it looks like

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

Labels

do not merge Do not merge this pull request patch A non-feature change, e.g. bug or issue fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants