Skip to content

Conversation

@UjjawalPrabhat
Copy link

@UjjawalPrabhat UjjawalPrabhat commented Oct 5, 2025

Overview

Removes the redundant referenceapplication-demo directory from the OpenMRS distribution build by introducing a Maven Antrun plugin execution post-SDK build. This ensures the demo folder does not appear in the final artifacts, maintaining a clean and correct output.

Details

  • Adds a targeted Maven Antrun step in distro/pom.xml to safely delete the referenceapplication-demo folder after the build-distro phase.
  • Does not affect core metadata or demo content, which remains preserved via the referencedemodata module.

Linked Resource

Checklist

  • Build completes with no errors
  • referenceapplication-demo folder removed from output
  • Demo content is still functional (referencedemodata)
  • Scripts/documentation provide complete verification and reporting

…tro output

- Adds Maven Antrun plugin step to delete the redundant referenceapplication-demo folder after SDK build
- Ensures demo content is preserved via referencedemodata module
- Maintains integrity of build and application functionality
- Implements safe, robust, and maintainable solution as per verification and best practices
@dkayiwa
Copy link
Member

dkayiwa commented Oct 7, 2025

@UjjawalPrabhat what are the exact steps to reproduce the unwanted demo folder?

@UjjawalPrabhat
Copy link
Author

@UjjawalPrabhat what are the exact steps to reproduce the unwanted demo folder?

Thanks for reviewing! Here’s how to reproduce the unwanted referenceapplication-demo folder:

  1. Clone the repo and switch to the 3.4.0 release tag:
  1. Run the SDK build-distro goal:
  • mvn clean package openmrs-sdk:build-distro -P distro
  1. Inspect the generated files in:
  • target/sdk-distro/web/

You will see both:
referenceapplication/…
referenceapplication-demo/…

The referenceapplication-demo folder is the unwanted directory.

Let me know if you need any more details!

@dkayiwa
Copy link
Member

dkayiwa commented Oct 8, 2025

Are you able to reproduce it with the 3.6.0-SNAPSHOT?

@UjjawalPrabhat
Copy link
Author

Are you able to reproduce it with the 3.6.0-SNAPSHOT?

@dkayiwa Apologies for the late response!

Yes, I can reproduce the issue with 3.6.0-SNAPSHOT.

On main (without fix): The unwanted referenceapplication-demo/ folder appears in the build output.

On my fix branch: The folder is successfully removed, leaving only the necessary directories (openmrs_config, openmrs_core, openmrs_modules, etc.).

Screenshot:
image

The fix works correctly without affecting other build artifacts or functionality. Demo content remains accessible via the referencedemodata module.

@UjjawalPrabhat
Copy link
Author

@dkayiwa The E2E test failures appear to be unrelated to this PR.

The failing tests (attachments.spec.ts and visit-note.spec.ts) are timing out while waiting for success notifications to appear. Since this PR only modifies the build artifact structure (removing the redundant referenceapplication-demo/ folder), it doesn't affect:

  • Runtime application code
  • Frontend notification logic
  • File attachment or visit note functionality

These look like flaky tests that may be affected by CI environment performance or an existing application issue. The fix itself has been verified to work correctly without impacting core functionality.

Would you like me to re-run the tests, or should we investigate these notification timeout issues separately?

<configuration>
<target>
<echo message="Removing unwanted referenceapplication-demo folders from build output..." />
<delete dir="${project.build.directory}/sdk-distro/web/referenceapplication-demo"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of deleting it, did you explore the option of just not creating it in the very first place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants