Skip to content

Commit c43fe9c

Browse files
STAND-129: Fix build-distro SNAPSHOT resolution in 3.x Standalone (#87)
* Testing out the snapShot Error Not fetching * Adding generate-distro then build-distro from openmrs-distro.properties * trying the openmrs-sdk-maven-plugin 6.4.0 version * trying the openmrs-sdk-maven-plugin 6.5.0 version and running openmrs-sdk-maven-plugin setup in CI * making setup-sdk uninteractive * using version 6.5.0 * using github/maven-settings.xml for Pre-run OpenMRS SDK * running Pre-run OpenMRS SDK in batch mode * rename Pre-run OpenMRS SDK to Pre-run OpenMRS SDK Plugin * renamed id from generate-distro to openmrs-sdk:generate-distro Co-authored-by: Herman Muhereza <hermanmuhereza22@gmail.com> * making openmrs.sdk.version generic also on ci --------- Co-authored-by: Herman Muhereza <hermanmuhereza22@gmail.com>
1 parent 19c474e commit c43fe9c

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

.github/maven-settings.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
<name>Mekom Repository</name>
3030
<url>https://nexus.mekomsolutions.net/repository/maven-public</url>
3131
</repository>
32+
<repository>
33+
<id>sonatype-central-snapshots</id>
34+
<name>Sonatype Central Snapshots</name>
35+
<url>https://central.sonatype.com/repository/maven-snapshots</url>
36+
</repository>
37+
<repository>
38+
<id>sonatype-nexus</id>
39+
<name>Sonatype Nexus Repository</name>
40+
<url>https://oss.sonatype.org/content/repositories/releases/</url>
41+
</repository>
3242
</repositories>
3343
<pluginRepositories>
3444
<pluginRepository>

.github/workflows/standalone-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
- name: Verify Docker Compose installation
3636
run: docker compose version
3737

38+
- name: Pre-run OpenMRS SDK Plugin
39+
run: mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk -B --settings .github/maven-settings.xml
40+
3841
- name: Run Maven Clean
3942
run: mvn clean --settings .github/maven-settings.xml
4043

@@ -55,6 +58,9 @@ jobs:
5558
java-version: '21'
5659
distribution: 'temurin'
5760

61+
- name: Pre-run OpenMRS SDK Plugin
62+
run: mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk -B --settings .github/maven-settings.xml
63+
5864
- name: Run Maven Clean
5965
run: mvn clean --settings .github/maven-settings.xml
6066

@@ -74,6 +80,9 @@ jobs:
7480
java-version: '21'
7581
distribution: 'temurin'
7682

83+
- name: Pre-run OpenMRS SDK Plugin
84+
run: mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:setup-sdk -B --settings .github/maven-settings.xml
85+
7786
- name: Run Maven Clean
7887
run: mvn clean --settings .github/maven-settings.xml
7988

pom-step-01.xml

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,53 @@
1818

1919
<build>
2020
<plugins>
21+
<plugin>
22+
<groupId>org.apache.maven.plugins</groupId>
23+
<artifactId>maven-antrun-plugin</artifactId>
24+
<version>3.1.0</version>
25+
<executions>
26+
<execution>
27+
<id>create-directories</id>
28+
<phase>generate-resources</phase>
29+
<goals>
30+
<goal>run</goal>
31+
</goals>
32+
<configuration>
33+
<target>
34+
<mkdir dir="${project.build.directory}/openmrs3x"/>
35+
</target>
36+
</configuration>
37+
</execution>
38+
</executions>
39+
</plugin>
2140
<plugin>
2241
<groupId>org.openmrs.maven.plugins</groupId>
2342
<artifactId>openmrs-sdk-maven-plugin</artifactId>
24-
<version>6.4.0</version>
43+
<version>${openmrs.sdk.version}</version>
2544
<executions>
2645
<execution>
27-
<id>build-distro</id>
46+
<id>openmrs-sdk:generate-distro</id>
2847
<phase>generate-resources</phase>
48+
<goals>
49+
<goal>generate-distro</goal>
50+
</goals>
51+
<configuration>
52+
<outputLocation>${project.build.directory}/openmrs3x</outputLocation>
53+
<batchAnswers>
54+
<batchAnswer>Reference Application 3.x</batchAnswer>
55+
<batchAnswer>${refapp.version}</batchAnswer>
56+
</batchAnswers>
57+
<testMode>true</testMode>
58+
</configuration>
59+
</execution>
60+
<execution>
61+
<id>openmrs-sdk:build-distro</id>
2962
<goals>
3063
<goal>build-distro</goal>
3164
</goals>
65+
<phase>generate-resources</phase>
3266
<configuration>
33-
<distro>referenceapplication:${refapp.version}</distro>
67+
<distro>${project.build.directory}/openmrs3x/openmrs-distro.properties</distro>
3468
<dir>${project.build.directory}/distro</dir>
3569
</configuration>
3670
</execution>
@@ -144,6 +178,11 @@
144178
</dependency>
145179
</dependencies>
146180
</plugin>
181+
<plugin>
182+
<groupId>org.openmrs.maven.plugins</groupId>
183+
<artifactId>openmrs-sdk-maven-plugin</artifactId>
184+
<version>${openmrs.sdk.version}</version>
185+
</plugin>
147186
</plugins>
148187
</pluginManagement>
149188
</build>

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
<tomcat.version>9.0.106</tomcat.version>
2424
<openmrs.version>2.7.4</openmrs.version>
25-
<refapp.version>3.4.0</refapp.version>
25+
<refapp.version>3.6.0-SNAPSHOT</refapp.version>
2626
<mariadb4jVersion>3.2.0</mariadb4jVersion>
2727
<junitVersion>5.12.2</junitVersion>
2828
<mockitoVersion>3.12.4</mockitoVersion>
29+
<openmrs.sdk.version>6.5.0</openmrs.sdk.version>
2930
</properties>
3031

3132
<dependencies>

0 commit comments

Comments
 (0)