STAND-129: Fix build-distro SNAPSHOT resolution in 3.x Standalone#87
STAND-129: Fix build-distro SNAPSHOT resolution in 3.x Standalone#87dkayiwa merged 11 commits intoopenmrs:openmrs-emr3from
Conversation
…-sdk-maven-plugin setup in CI
Co-authored-by: Herman Muhereza <hermanmuhereza22@gmail.com>
.github/workflows/standalone-ci.yml
Outdated
| run: docker compose version | ||
|
|
||
| - name: Pre-run OpenMRS SDK Plugin | ||
| run: mvn org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:6.5.0:setup-sdk -B --settings .github/maven-settings.xml |
There was a problem hiding this comment.
Did you intentionally hard code 6.5.0?
There was a problem hiding this comment.
Oh yes because by default this was fetching 5.5.4 version instead of the latest
There was a problem hiding this comment.
So we shall be updating this everytime the sdk is released?
There was a problem hiding this comment.
Oh makes sense should be this way let me see how to specify it in a generic way
|
cc @dkayiwa this change fixes the issue |
| - name: Verify Docker Compose installation | ||
| run: docker compose version | ||
|
|
||
| - name: Pre-run OpenMRS SDK Plugin |
There was a problem hiding this comment.
Why do we now need this in the standalone but not in the SDK?
There was a problem hiding this comment.
Because the Standalone build uses the SDK Maven plugin to generate and build the distro, it needs a pre-configured SDK environment — which the local machine already has but CI doesn’t. The SDK project itself just builds the tool, so it doesn’t require that setup to compile.
See https://openmrs.atlassian.net/browse/STAND-129
Description
Problem:
The OpenMRS SDK Maven Plugin build-distro fails for SNAPSHOT versions (e.g., 3.6.0-SNAPSHOT) in CI due to missing directories or unresolved SNAPSHOT artifacts.
Locally, builds may succeed because Maven caches artifacts, but CI consistently fails with artifact null errors.
Solution:
This PR implements a robust approach that works for both local and CI builds:
Pre-create directories for distro artifacts using maven-antrun-plugin:
Configure openmrs-sdk-maven-plugin for generate-distro and build-distro:
CI pre-run step:
Before running Maven goals in CI, ensure the SDK is set up non-interactively with proper settings:
Benefits:
Works consistently for SNAPSHOT and release versions locally and in CI.
Eliminates artifact null errors.
Does not change the developer workflow for local builds.
Testing:
✅ Local build:
mvn clean package -Drefapp.version=3.6.0-SNAPSHOTsucceeds.✅ Local build:
mvn clean package -Drefapp.version=3.6.0-SNAPSHOTsucceeds.✅ CI build passes after pre-running setup-sdk.