From 4aa7678b1f40fe8d6e5ccc0ca1910bfdedea5ad7 Mon Sep 17 00:00:00 2001 From: Wikum Weerakutti Date: Fri, 16 May 2025 18:11:35 +0530 Subject: [PATCH] HTMLWIDGETS-26: Migrate to Platfrom 2.7.0 and Support Java 21 --- .github/workflows/maven.yml | 29 +++++++++++++++++++ api/pom.xml | 2 +- .../resources/TestingApplicationContext.xml | 16 +++++----- omod/pom.xml | 2 +- .../module/htmlwidgets/web/demo/Demo.java | 10 +++++-- pom.xml | 28 +++++++++++++++--- 6 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 0000000..56c6d8a --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,29 @@ +# this build is designed to replicate the Travis CI workflow +name: Java CI with Maven + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [8, 11, 17, 21, 24] + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + + - name: Build with Maven + run: mvn clean install --file pom.xml diff --git a/api/pom.xml b/api/pom.xml index 15d6a03..37241fe 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -3,7 +3,7 @@ org.openmrs.module htmlwidgets - 1.12.0-SNAPSHOT + 2.0.0-SNAPSHOT htmlwidgets-api jar diff --git a/api/src/test/resources/TestingApplicationContext.xml b/api/src/test/resources/TestingApplicationContext.xml index 81c3d56..8bc821d 100644 --- a/api/src/test/resources/TestingApplicationContext.xml +++ b/api/src/test/resources/TestingApplicationContext.xml @@ -1,13 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> diff --git a/omod/pom.xml b/omod/pom.xml index 8909585..2fbfc10 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -3,7 +3,7 @@ org.openmrs.module htmlwidgets - 1.12.0-SNAPSHOT + 2.0.0-SNAPSHOT htmlwidgets-omod jar diff --git a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/demo/Demo.java b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/demo/Demo.java index 3e86a43..75d19ea 100644 --- a/omod/src/main/java/org/openmrs/module/htmlwidgets/web/demo/Demo.java +++ b/omod/src/main/java/org/openmrs/module/htmlwidgets/web/demo/Demo.java @@ -34,14 +34,20 @@ import org.openmrs.ProgramWorkflow; import org.openmrs.ProgramWorkflowState; import org.openmrs.User; -import org.openmrs.api.PatientSetService.PatientLocationMethod; /** * Demonstration / test bean to encapsulate the properties that can be set * using the Widget Framework */ public class Demo { - + + enum PatientLocationMethod { + EARLIEST_ENCOUNTER, + LATEST_ENCOUNTER, + ANY_ENCOUNTER, + PATIENT_HEALTH_CENTER; + } + // ******* CONSTRUCTORS ******** public Demo() { } diff --git a/pom.xml b/pom.xml index 7fa6092..86fd802 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.openmrs.module htmlwidgets - 1.12.0-SNAPSHOT + 2.0.0-SNAPSHOT pom HTML Widgets Parent project for HTML Widgets @@ -69,6 +69,16 @@ tests jar test + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-api-mockito2 + + @@ -77,11 +87,21 @@ ${openMRSVersion} pom test + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-api-mockito2 + + - 1.9.9 + 2.7.3 UTF-8 ${project.parent.artifactId} @@ -154,8 +174,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 1.8 + 1.8