How to watch/build a module that relies on changes in another module

I am testing changes in two modules. The specific changes don’t really matter but I’ll post them anyway for the sake of illustration:

In openmrs-module-emrapi, I am adding a variable PRIVILEGE_LEVEL_SAFE_UUID that I later reference in openmrs-module-referencemetadata. I have added both projects to the watch list by using mvn openmrs-sdk:watch and I can even confirm that the emrapi module builds before the referencemetadata module. However, the reference metadata module fails with the following error:

[ERROR] /root/openmrs/vanilla/watched-projects/referencemetadata/api/src/main/java/org/openmrs/module/referencemetadata/[190,82] cannot find symbol
[ERROR] location: class org.openmrs.module.emrapi.EmrApiConstants

My question: how do I force openmrs-module-referencemetadata to use the most recently compiled version of openmrs-module-emrapi when building with the sdk?


Seems like the changes you need to pull in are in the master branch of emrapi, then you need to set the version number of the dependency in the reference metadata module to the snapshot version of emrapi.

Is there a way to test that my changes to referencemetadata (dependent on changes to emrapi) will work without pushing my changes in emrapi to master?

You need to change to use the latest SNAPSHOT of emrapi.

@raff @wyclif using 1.24.0-SNAPSHOT here did the trick. Thanks!