-
Notifications
You must be signed in to change notification settings - Fork 126
UIFR-226: Update to OpenMRS platform 2.7.3 and Support Java 21 #87
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
Conversation
28699df
to
5d5c92e
Compare
I'm encountering a test error when running with Java 17, but the same tests pass without issues on Java 21 and Java 24. Any idea what might be causing this? https://gist.github.com/wikumChamith/c207c6b890e88e42c0f8ee4bd00a6297 |
The most common cause I see from a quick search is having the wrong version of byte-buddy on the classpath... It needs 1.12+. Alternatively, maybe we can drop the dependency on PowerMock? It only seems to be used for this import and is notoriously fragile to version changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good to me @wikumChamith , nice work. A few comments for consideration
.github/workflows/maven.yml
Outdated
@@ -13,7 +13,7 @@ jobs: | |||
|
|||
strategy: | |||
matrix: | |||
java-version: [8, 11, 17] | |||
java-version: [8, 11, 21, 24] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to figure out why 17 doesn't work, and fix it and support it.
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>servlet-api</artifactId> | ||
<artifactId>javax.servlet-api</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we eliminate the need for this dependency in the api module while we are at this? Not really in the scope of this ticket, but generally the API should not have this kind of web dependency.
pom.xml
Outdated
@@ -43,17 +37,17 @@ | |||
</modules> | |||
|
|||
<properties> | |||
<openmrsPlatformVersion>2.0.0</openmrsPlatformVersion> | |||
<springVersion>4.1.4.RELEASE</springVersion> | |||
<openmrsPlatformVersion>2.7.3</openmrsPlatformVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be 2.7.0, or does it need to be 2.7.3?
pom.xml
Outdated
<openmrsPlatformVersion>2.0.0</openmrsPlatformVersion> | ||
<springVersion>4.1.4.RELEASE</springVersion> | ||
<openmrsPlatformVersion>2.7.3</openmrsPlatformVersion> | ||
<springVersion>5.3.30</springVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still used?
<target>1.7</target> | ||
<source>1.7</source> | ||
<target>1.8</target> | ||
<source>1.8</source> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: should this just be 8
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we need to set the source to at least Java 8 to compile with Java 21.
I tried adding both byte-buddy and byte-buddy-agent, but still got the error. Adding powermock as an exclusion worked. |
Is there a reason we're testing with Java 24? I'd prefer not to make things dependent on non-LTS releases of the JDK, as they generally have a 6-month lifespan and are then retired. |
I decided to add this because now we have a Java 24 build in core: openmrs/openmrs-core@2aa544c. In the last platform meeting, @dkayiwa explained that we should try to support the latest version of JDK even if it is not an LTS. |
<dependency> | ||
<groupId>net.bytebuddy</groupId> | ||
<artifactId>byte-buddy</artifactId> | ||
<version>1.15.10</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you add scope to these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wikumChamith did you see the above comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I'll update this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkayiwa I updated the PR.
37f1231
to
473a4f8
Compare
I get the same exact error when i compile locally |
Here is my log: https://pastebin.com/Lrgb6sj5 |
@wikumChamith try changing the failing test's base class to |
That fixed the issue. Do you know why I was not getting the error locally? |
Where you compiling from your IDE? |
Tried on both the IDE and terminal. |
Did you try with more than one version of Java? |
Yeah, Java 8,17,21 and 24. Anyway your suggestion fixed the issue on GitHub :) |
Are we going to create a branch for lower platform versions? And also bump the version of the module? |
Yes. I created a new branch: https://github.com/openmrs/openmrs-module-uiframework/tree/3.x |
Ticket: https://openmrs.atlassian.net/browse/UIFR-226