From 1f1c5526aa7693a3782ed2d84453717264fbfa38 Mon Sep 17 00:00:00 2001 From: Michael Seaton Date: Fri, 15 Nov 2024 16:31:06 -0500 Subject: [PATCH] SDK-354 - follow-up fix for O3 distribution --- .../java/org/openmrs/maven/plugins/utility/DefaultWizard.java | 4 ++-- .../java/org/openmrs/maven/plugins/utility/DistroHelper.java | 3 ++- .../java/org/openmrs/maven/plugins/utility/SDKConstants.java | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DefaultWizard.java b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DefaultWizard.java index d7128cf1..fecfb95a 100644 --- a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DefaultWizard.java +++ b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DefaultWizard.java @@ -790,7 +790,7 @@ private Map getO3VersionsOptionsMap(VersionsHelper versionsHelpe Map optionsMap = new LinkedHashMap<>(); { - Artifact artifact = new Artifact("distro-emr-configuration", "3.0.0", "org.openmrs", "zip"); + Artifact artifact = new Artifact(SDKConstants.REFAPP_DISTRO_EMR_CONFIGURATION, "3.0.0", "org.openmrs", "zip"); for (ArtifactVersion version : versionsHelper.getAllVersions(artifact, MAX_OPTIONS_SIZE)) { optionsMap.put(String.format(optionTemplate, version.toString()), artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + version); } @@ -801,7 +801,7 @@ private Map getO3VersionsOptionsMap(VersionsHelper versionsHelpe } { - Artifact artifact = new Artifact("referenceapplication-distro", "3.0.0", "org.openmrs.distro", "zip"); + Artifact artifact = new Artifact(SDKConstants.REFAPP_DISTRO, "3.0.0", "org.openmrs.distro", "zip"); for (ArtifactVersion version : versionsHelper.getAllVersions(artifact, MAX_OPTIONS_SIZE)) { if (!version.toString().endsWith("-SNAPSHOT") && optionsMap.size() < MAX_OPTIONS_SIZE) { optionsMap.put(String.format(optionTemplate, version), diff --git a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DistroHelper.java b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DistroHelper.java index b39ffb17..68677ff2 100644 --- a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DistroHelper.java +++ b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/DistroHelper.java @@ -548,7 +548,8 @@ public Properties getFrontendProperties(Server server) throws MojoExecutionExcep } public Properties getFrontendPropertiesForServer(Artifact artifact, File directory) throws MojoExecutionException { - if (artifact.getArtifactId().equals("referenceapplication-distro")) { + String artifactId = artifact.getArtifactId(); + if (artifactId.equals(SDKConstants.REFAPP_DISTRO) || artifactId.equals(SDKConstants.REFAPP_DISTRO_EMR_CONFIGURATION)) { if (new Version(artifact.getVersion()).higher(new Version("3.0.0-beta.16"))) { return getFrontendProperties(artifact, directory); } else { diff --git a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/SDKConstants.java b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/SDKConstants.java index 72264b32..30987243 100644 --- a/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/SDKConstants.java +++ b/sdk-commons/src/main/java/org/openmrs/maven/plugins/utility/SDKConstants.java @@ -86,6 +86,9 @@ public class SDKConstants { public static final List SUPPPORTED_REFAPP_VERSIONS_2_3_1_OR_LOWER = java.util.Arrays.asList("2.3.1", "2.2", "2.1"); private final static String[] SUPPORTED_MODULE_EXTENSIONS = new String[]{Artifact.TYPE_WAR, Artifact.TYPE_JAR, Artifact.TYPE_OMOD}; + public static final String REFAPP_DISTRO = "referenceapplication-distro"; + public static final String REFAPP_DISTRO_EMR_CONFIGURATION = "distro-emr-configuration"; + // version keywords public static final String LATEST_VERSION_BATCH_KEYWORD = "LATEST"; public static final String LATEST_SNAPSHOT_BATCH_KEYWORD = "LATEST-SNAPSHOT";