Skip to content

Commit 4aa7678

Browse files
committed
HTMLWIDGETS-26: Migrate to Platfrom 2.7.0 and Support Java 21
1 parent 2412eb9 commit 4aa7678

6 files changed

Lines changed: 71 additions & 16 deletions

File tree

.github/workflows/maven.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# this build is designed to replicate the Travis CI workflow
2+
name: Java CI with Maven
3+
4+
on:
5+
push:
6+
branches: [ "master" ]
7+
pull_request:
8+
branches: [ "master" ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
java: [8, 11, 17, 21, 24]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up JDK ${{ matrix.java }}
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: ${{ matrix.java }}
25+
distribution: 'temurin'
26+
cache: maven
27+
28+
- name: Build with Maven
29+
run: mvn clean install --file pom.xml

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.openmrs.module</groupId>
55
<artifactId>htmlwidgets</artifactId>
6-
<version>1.12.0-SNAPSHOT</version>
6+
<version>2.0.0-SNAPSHOT</version>
77
</parent>
88
<artifactId>htmlwidgets-api</artifactId>
99
<packaging>jar</packaging>

api/src/test/resources/TestingApplicationContext.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans xmlns="http://www.springframework.org/schema/beans"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
4-
xmlns:util="http://www.springframework.org/schema/util"
5-
xsi:schemaLocation="http://www.springframework.org/schema/beans
6-
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
7-
http://www.springframework.org/schema/context
8-
http://www.springframework.org/schema/context/spring-context-3.0.xsd
9-
http://www.springframework.org/schema/util
10-
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://www.springframework.org/schema/beans
5+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
116

127
<!--
138
From applicationContext-service.xml in openmrs-api
@@ -23,6 +18,11 @@
2318
<property name="mappingJarLocations">
2419
<ref bean="mappingJarResources" />
2520
</property>
21+
<property name="packagesToScan">
22+
<list>
23+
<value>org.openmrs</value>
24+
</list>
25+
</property>
2626
<!-- default properties must be set in the hibernate.default.properties -->
2727
</bean>
2828

omod/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.openmrs.module</groupId>
55
<artifactId>htmlwidgets</artifactId>
6-
<version>1.12.0-SNAPSHOT</version>
6+
<version>2.0.0-SNAPSHOT</version>
77
</parent>
88
<artifactId>htmlwidgets-omod</artifactId>
99
<packaging>jar</packaging>

omod/src/main/java/org/openmrs/module/htmlwidgets/web/demo/Demo.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@
3434
import org.openmrs.ProgramWorkflow;
3535
import org.openmrs.ProgramWorkflowState;
3636
import org.openmrs.User;
37-
import org.openmrs.api.PatientSetService.PatientLocationMethod;
3837

3938
/**
4039
* Demonstration / test bean to encapsulate the properties that can be set
4140
* using the Widget Framework
4241
*/
4342
public class Demo {
44-
43+
44+
enum PatientLocationMethod {
45+
EARLIEST_ENCOUNTER,
46+
LATEST_ENCOUNTER,
47+
ANY_ENCOUNTER,
48+
PATIENT_HEALTH_CENTER;
49+
}
50+
4551
// ******* CONSTRUCTORS ********
4652
public Demo() { }
4753

pom.xml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.openmrs.module</groupId>
66
<artifactId>htmlwidgets</artifactId>
7-
<version>1.12.0-SNAPSHOT</version>
7+
<version>2.0.0-SNAPSHOT</version>
88
<packaging>pom</packaging>
99
<name>HTML Widgets</name>
1010
<description>Parent project for HTML Widgets</description>
@@ -69,6 +69,16 @@
6969
<classifier>tests</classifier>
7070
<type>jar</type>
7171
<scope>test</scope>
72+
<exclusions>
73+
<exclusion>
74+
<groupId>org.powermock</groupId>
75+
<artifactId>powermock-api-mockito</artifactId>
76+
</exclusion>
77+
<exclusion>
78+
<groupId>org.powermock</groupId>
79+
<artifactId>powermock-api-mockito2</artifactId>
80+
</exclusion>
81+
</exclusions>
7282
</dependency>
7383

7484
<dependency>
@@ -77,11 +87,21 @@
7787
<version>${openMRSVersion}</version>
7888
<type>pom</type>
7989
<scope>test</scope>
90+
<exclusions>
91+
<exclusion>
92+
<groupId>org.powermock</groupId>
93+
<artifactId>powermock-api-mockito</artifactId>
94+
</exclusion>
95+
<exclusion>
96+
<groupId>org.powermock</groupId>
97+
<artifactId>powermock-api-mockito2</artifactId>
98+
</exclusion>
99+
</exclusions>
80100
</dependency>
81101
</dependencies>
82102

83103
<properties>
84-
<openMRSVersion>1.9.9</openMRSVersion>
104+
<openMRSVersion>2.7.3</openMRSVersion>
85105
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
86106

87107
<MODULE_ID>${project.parent.artifactId}</MODULE_ID>
@@ -154,8 +174,8 @@
154174
<groupId>org.apache.maven.plugins</groupId>
155175
<artifactId>maven-compiler-plugin</artifactId>
156176
<configuration>
157-
<target>1.6</target>
158-
<source>1.6</source>
177+
<target>1.8</target>
178+
<source>1.8</source>
159179
</configuration>
160180
</plugin>
161181

0 commit comments

Comments
 (0)