RESTWS-1004: Upgrade to use Jakarta #686
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of what I changed
This PR upgrades the project to jakarta and to the latest OpenMRS core 3.x
Issue I worked on
see https://issues.openmrs.org/browse/RESTWS-1004
This is dependent on two other PRs that need merged first:
LegacyUI task - github.com/openmrs/openmrs-module-legacyui/pull/221
Core task - openmrs/openmrs-core#5523
Important changes
I tried as much as possible to avoid changing tests to avoid regression but it was unavoidable in some places so please scrutinize if these test changes could have any impact.
FieldAnswerResource1_8- Answers were removed from Field in core but please advise if we need to handle this another way.ClearDbCacheController2_0Testdue to deprecation: https://docs.hibernate.org/orm/5.5/javadocs/org/hibernate/stat/Statistics.html#getSecondLevelCacheStatistics-java.lang.String-CommonsMultipartResolverhas been removed, recommendation is to replace withorg.springframework.web.multipart.support.StandardServletMultipartResolver. See https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.0-Release-Notes however it doesn't seem to have an alternative for max sizeuuidin path so renamed the parent one inFormResourceController1_9Bytebuddydependency added for hibernate, no longer was being pulled in transitivelyClobDatatypeStorageControllercreatemethod, not sure why it was needed, but spring couldn't infer it after the upgrade.PasswordResetController2_2Test>resetPassword_shouldResetUserPasswordIfActivationKeyIsCorrectwas failing due to the recent changes in TRUNK-6435 limiting what can call methods to reset passwords. After speaking to @ibacher Instead what we do now is call setUserActivationKey which doesn't have the same check. The alternative would be to add to the allowed callers here - https://github.com/openmrs/openmrs-core/blob/471e1244286d71d1d4a171cebcb657c6a3a27e95/api/src/main/java/org/openmrs/api/db/hibernate/HibernateUserDAO.java#L643ChangePasswordController1_8Test>testUserChangeOtherUsersPasswordWithOutPrivilegewas failing due to some changes inside spring that doesn't allow null locale inMessageSourceSupport. We pass null locales when throwing exceptions inAuthorizationAdviceso I added the default locale which fixed it. - TRUNK-6478 Populate null locales for Spring MessageSource openmrs-core#5523taskSchedulerDataset.xmlas there were mandatory fields missing and a change in field name -created_bytocreatorChecklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amendI have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amendI ran
mvn clean packageright before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master