Need Help: Issue with Deploying module-patientflags using OpenMRS SDK

Hi everyone, I’m trying to deploy my OpenMRS module using the OpenMRS SDK with the following command:

mvn openmrs-sdk:deploy -DserverId=server

However, the deployment of module-patientflags gets aborted without a clear error message. I’m sure the module build successfully without any error . here is the full log :

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\sandu\Documents\openmrs-module-patientflags> mvn openmrs-sdk:deploy -DserverId=server
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Patient Flags Module                                               [pom]
[INFO] Patient Flags Module API                                           [jar]
[INFO] Patient Flags Module Metadata API                                  [jar]
[INFO] Patient Flags Module FHIR                                          [jar]
[INFO] Patient Flags Module OMOD                                          [jar]
[WARNING] Ignoring incompatible plugin version 4.0.0-beta-2: The plugin org.apache.maven.plugins:maven-compiler-plugin:4.0.0-beta-2 requires Maven version 4.0.0-rc-2
[INFO] Latest version of plugin org.apache.maven.plugins:maven-compiler-plugin failed compatibility check
[INFO] Looking for compatible RELEASE version of plugin org.apache.maven.plugins:maven-compiler-plugin
[WARNING] Ignoring incompatible plugin version 4.0.0-beta-1: The plugin org.apache.maven.plugins:maven-compiler-plugin:4.0.0-beta-1 requires Maven version 4.0.0-beta-3
[INFO] Selected plugin org.apache.maven.plugins:maven-compiler-plugin:3.14.0
[INFO] 
[INFO] ------------------< org.openmrs.module:patientflags >-------------------
[INFO] Building Patient Flags Module 3.0.9-SNAPSHOT                       [1/5]
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- openmrs-sdk:6.1.0:deploy (default-cli) @ patientflags ---
Mar 11, 2025 2:38:29 PM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)

Would you like to deploy patientflags 3.0.9-SNAPSHOT from the current directory? [Y/n]: Y

Do you want to update module 'patientflags' in version '3.0.8' to version '3.0.9-SNAPSHOT'? [Y/n]: Y
[INFO] Deploying module 'patientflags-omod' aborted
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Patient Flags Module 3.0.9-SNAPSHOT:
[INFO]
[INFO] Patient Flags Module ............................... SUCCESS [  9.010 s]
[INFO] Patient Flags Module API ........................... SKIPPED
[INFO] Patient Flags Module Metadata API .................. SKIPPED
[INFO] Patient Flags Module FHIR .......................... SKIPPED
[INFO] Patient Flags Module OMOD .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.810 s
[INFO] Finished at: 2025-03-11T14:38:37+05:30
[INFO] ------------------------------------------------------------------------
PS C:\Users\sandu\Documents\openmrs-module-patientflags> 

1 Like

It looks like your module build was successful, but deployment was aborted. Try these steps to troubleshoot:

  1. Check OpenMRS Logs – Look for errors in openmrs/logs/openmrs.log.

  2. Manual Deployment – Copy omod/target/patientflags-3.0.9-SNAPSHOT.omod to ~/.OpenMRS/modules/ and restart OpenMRS.

  3. Verify Compatibility – Ensure your OpenMRS SDK and platform version match the module requirements. Run mvn clean install.

  4. Enable Debug Mode – Run:

mvn openmrs-sdk:deploy -DserverId=server -X

This will provide more details on the issue. Let us know what errors you find!

Deploying module 'patientflags-omod' aborted

This happens because there was an issue deleting the existing OMOD. Most likely, you have some process that still has that file open. Are you running the SDK server while trying to deploy the OMOD?

I noticed that if a module is currently running, we can update it using the command: mvn openmrs-sdk:deploy -DserverId=server.

However, if we need to update the module, we should first unload it. I couldn’t find any command to stop a module, so I have to manually delete it, stop the server, and then redeploy the module. This process is very time-consuming. Please help me find a better solution.

You shouldn’t need to manually delete it. The SDK’s deploy command will take care of that for you. You do need to stop the server to deploy the OMOD. Unfortunately, we can’t really fix Window’s file locking. If your installation is setup to handle it, you can upload new modules via the UI, but in that instance, you may have to use the UI to stop the previous version of the module.