Does openmrs-sdk-maven-plugin:4.0.1 override group ids?

Hey there,

I am using the openmrs-sdk-maven-plugin:4.0.1 to build a Dockerfile for an OpenMRS image with bundled modules.

openmrs-distro.properties defines

omod.openmrs-atomfeed=${openmrs-atomfeedVersion}

and pom.xml defines

<properties>
  ...
  <openmrs-atomfeedVersion>2.5.6</openmrs-atomfeedVersion>
  ...
</properties>

<dependencyManagement>
  <dependencies>
    ...
    <dependency>
      <groupId>org.ict4h.openmrs</groupId>
      <artifactId>openmrs-atomfeed-omod</artifactId>
      <version>${openmrs-atomfeedVersion}</version>
      <type>jar</type>
    </dependency>
    ...
  </dependencies>
</dependencyManagement>

Running mvn clean install fails with

[INFO] Configured Artifact: org.openmrs.module:openmrs-atomfeed-omod:2.5.6:jar
Downloading: https://mavenrepo.openmrs.org/public/org/openmrs/module/openmrs-atomfeed-omod/2.5.6/openmrs-atomfeed-omod-2.5.6.jar
Downloading: https://mavenrepo.openmrs.org/public/org/openmrs/module/openmrs-atomfeed-omod/2.5.6/openmrs-atomfeed-omod-2.5.6.jar
Downloading: https://mavenrepo.openmrs.org/thirdparty/org/openmrs/module/openmrs-atomfeed-omod/2.5.6/openmrs-atomfeed-omod-2.5.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/openmrs/module/openmrs-atomfeed-omod/2.5.6/openmrs-atomfeed-omod-2.5.6.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.642 s
[INFO] Finished at: 2021-06-13T18:44:31+02:00
[INFO] Final Memory: 23M/94M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:4.0.1:build-distro (build-distro) on project platform: Unable to execute mojo: Unable to find artifact. Could not find artifact org.openmrs.module:openmrs-atomfeed-omod:jar:2.5.6 in openmrs-repo (https://mavenrepo.openmrs.org/public)

Please note that the group id has changed, the openmrs-sdk-maven-plugin tries to download

org.openmrs.module:openmrs-atomfeed-omod:jar:2.5.6

while the actual dependency is

org.ict4h.openmrs:openmrs-atomfeed-omod:jar:2.5.6

The same behaviour happens for other dependencies where the group id is not org.openmrs.module.

Is it possible that the openmrs-sdk-maven-plugin overrides the group id?

Thank you, Wolf

1 Like

Looking into the codebase of the OpenMRS SDK helped me finding the answer, the group id assumed for all modules in the openmrs-distro.properties file is org.openmrs.module, regardless of the group id specified for the dependency.

1 Like

Yeah, to be more precise, the idea of the build-distro function in the SDK is to create a functional distribution from just an openmrs-distro.properties file, but obviously this doesn’t have enough information to handle dependencies properly.

@wolf - this isn’t actually true, org.openmrs.module is just the default.

If you look at the referenceapplication openmrs-distro.properties, and look at the event module, you’ll see how this is handled:

Mike

1 Like

Thanks Mike! That’s really cool!

Thanks @mseaton , that is great news.