# OpenMRS Reference Application 3 using Maven SDK

**URL:** <https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212>\
**Category:** Development\
**Tags:** openmrs-sdk, maven, o3\
**Created:** [November 30, 2024, 5:16pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212 "2024-11-30T17:16:07Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![prateek\_cs\_india](https://talk.openmrs.org/letter_avatar/prateek_cs_india/32/5_5575768a8748004e209b776fc1b2916d.png) [@prateek\_cs\_india](https://talk.openmrs.org/u/prateek_cs_india)\
**Post date:** [November 30, 2024, 5:16pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/1 "2024-11-30T17:16:07Z")

</div>

**Application Name:** Reference Application **Version Number:** OpenMRS 3 .

**Question:** I am struggling to use the maven sdk to use the config files for the spa frontend modules. The config works perfectly when i use the dockerized distro. when i update the config-core\_demo.json here, and run using docker compose up --build, i can see my changes. However, I am not able to setup the mvn openmrs-sdk. Can someone please help me with this? @mksd @dkayiwa

---

<div class="post-metadata">

**Author:** ![grace](https://talk.openmrs.org/user_avatar/talk.openmrs.org/grace/32/16942_2.png) [@grace](https://talk.openmrs.org/u/grace)\
**Post date:** [December 2, 2024, 7:27am UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/2 "2024-12-02T07:27:17Z")

</div>

Thank you so much for reaching our @prateek_cs_india and not suffering in silence 😃

@wikumc or @dkayiwa might you have suggestions for Prateek?

---

<div class="post-metadata">

**Author:** ![prateek\_cs\_india](https://talk.openmrs.org/letter_avatar/prateek_cs_india/32/5_5575768a8748004e209b776fc1b2916d.png) [@prateek\_cs\_india](https://talk.openmrs.org/u/prateek_cs_india)\
**Post date:** [December 3, 2024, 10:47am UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/3 "2024-12-03T10:47:23Z")

</div>

Thanks @grace. I have worked with 2.x in the past and I wanted to explore the micro-front end approach. It looks very exciting to me so far (off course I have a few minor config related challenges). I was wondering if we are planning to go on the micro-services side in the back-end as well with a multi-database model. For example, appointments go in a silo, the core emr-handles the patient data, and so on.

In the meantime, I would still need some help on the sdk configuration 🙂

---

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [December 3, 2024, 11:05am UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/4 "2024-12-03T11:05:31Z")

</div>

@prateek_cs_india What specific help do you need with the SDK?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [December 3, 2024, 11:11am UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/5 "2024-12-03T11:11:22Z")

</div>

> [@prateek\_cs\_india](#):
>
> I was wondering if we are planning to go on the micro-services side in the back-end as well with a multi-database model.

Not yet. As for all our current use cases, a modular monolith with a single database, is the appropriate architecture.

---

<div class="post-metadata">

**Author:** ![prateek\_cs\_india](https://talk.openmrs.org/letter_avatar/prateek_cs_india/32/5_5575768a8748004e209b776fc1b2916d.png) [@prateek\_cs\_india](https://talk.openmrs.org/u/prateek_cs_india)\
**Post date:** [December 3, 2024, 12:06pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/6 "2024-12-03T12:06:03Z")

</div>

@wikumc Can I configure the sdk to use a config.json file which could then be utilised by the spa files.

I am trying to achieve the feature using something similar to [this file here](https://github.com/openmrs/openmrs-distro-referenceapplication/blob/main/frontend/config-core_demo.json)

I see the npx openmrs tooling building/importing the assets into the ~/openmrs/\<server\_id\>/frontend/ directory.

---

<div class="post-metadata">

**Author:** ![wikumc](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wikumc/32/21813_2.png) [@wikumc](https://talk.openmrs.org/u/wikumc)\
**Post date:** [December 3, 2024, 1:23pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/7 "2024-12-03T13:23:15Z")

</div>

No, we currently don’t have that feature in the SDK.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [December 3, 2024, 2:24pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/8 "2024-12-03T14:24:09Z")

</div>

> [@prateek\_cs\_india](#):
>
> Can I configure the sdk to use a config.json file which could then be utilised by the spa files.

I do believe this is possible, based on what I learned yesterday from @ibacher , especially if you package your config.json in a content package and deploy both your frontend and content via a distribution. Is that correct @ibacher ?

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [December 3, 2024, 2:32pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/9 "2024-12-03T14:32:44Z")

</div>

Yes. I think you also need:

```auto
spa.configUrls=/openmrs/spa/openmrs-config.json

```

In your distro.properties.

---

<div class="post-metadata">

**Author:** ![prateek\_cs\_india](https://talk.openmrs.org/letter_avatar/prateek_cs_india/32/5_5575768a8748004e209b776fc1b2916d.png) [@prateek\_cs\_india](https://talk.openmrs.org/u/prateek_cs_india)\
**Post date:** [December 3, 2024, 6:40pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/10 "2024-12-03T18:40:25Z")

</div>

@ibacher I tried with

```auto
spa.configUrls=/openmrs/spa/openmrs-config.json

```

however it did not reflect my changes when I restarted the server using the sdk.

Do you think we can upgrade the sdk itslef to take in additional parameters for the build config file(s)? What I am suggesting is to achieve something similar to what we have in the distro’s Dockerfile here.

eventually we could see:

mvn openmrs-sdk:setup -DspaConfig=spa-config.json

spa-config should have info about the build and assemble file and the sdk should be able to pick each of those configs and eventually run the npx openmrs tooling with the right arguments, if available.

Can I explore this option and maybe work on it?

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [December 3, 2024, 6:53pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/11 "2024-12-03T18:53:11Z")

</div>

@prateek_cs_india As @mseaton said above, this only works if your frontend configuration is in a _content package_. Just adding what I suggested isn’t everything that needs to be done. (And passing the frontend config as an option to the SDK isn’t really going to be a long-term sustainable thing, so I’d rather we not pursue that).

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [December 3, 2024, 6:54pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/12 "2024-12-03T18:54:35Z")

</div>

The frontend configuration is really a part of the frontend system. The thing that’s currently not working is that there’s no where you can put a `config.json` that will be magically added by the SDK to the frontend. If the frontend configuration is provided as part of a content package it gets added in. This is basically a result of how the SDK commands are structured vs how the Docker stuff is setup.

---

<div class="post-metadata">

**Author:** ![prateek\_cs\_india](https://talk.openmrs.org/letter_avatar/prateek_cs_india/32/5_5575768a8748004e209b776fc1b2916d.png) [@prateek\_cs\_india](https://talk.openmrs.org/u/prateek_cs_india)\
**Post date:** [December 3, 2024, 7:09pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/13 "2024-12-03T19:09:05Z")

</div>

I feel like if we can have a wizard of sorts which prompts inputs from the end user(s) perhaps not exactly a SDK, which could help configure the installation on a machine - be it local, UAT or for PROD, could a newbie get started quicker. I went through the docs and felt ever so confused on which path to take. I using a distro as of right now, and I am trying to build a small script which sets up everything based on a few prompts/input-file. I will share an update if I get it working.

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [December 3, 2024, 7:28pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/14 "2024-12-03T19:28:29Z")

</div>

The SDK is intended as that tooling. I think what needs to be recognised, though, is that not all parts of O3 have been integrated into that tooling, because it’s not immediately clear how all of that makes sense. FWIW, we need to extend the SDK, we just need to also be careful about what this config file _is_ and where it’s expected to be drawn from as part of a distribution. The goal here isn’t just to get newbies up and working quickly, but also have tooling that’s robust enough to work with existing distributions that are described. The reason that it hasn’t been dealt with is that we haven’t yet worked out the best way to include it (if you just want to modify the config, use the O3 implementer tools to do so live; it’s a much better experience than modifying a file and restarting things).

---

<div class="post-metadata">

**Author:** ![ibacher](https://talk.openmrs.org/user_avatar/talk.openmrs.org/ibacher/32/19751_2.png) [@ibacher](https://talk.openmrs.org/u/ibacher)\
**Post date:** [December 3, 2024, 7:31pm UTC](https://talk.openmrs.org/t/openmrs-reference-application-3-using-maven-sdk/44212/15 "2024-12-03T19:31:06Z")

</div>

To be completely transparent about this, it’s the config\_core-demo.json file that’s part of the distribution that’s the non-standard part. That’s not necessarily how things are expected to be packaged and deployed and I wouldn’t use it as a model of anything. It’s a quick hack to demonstrate using the configuration system in a distro.
