Adding openmrs-module-aijar as a maven dependency to your new module should automatically pull it in along with its dependencies.
I don’t think you need to extend the properties file, looking at it I see that it pretty defines module versions which are the same module dependencies for openmrs-module-aijar anyways, by pulling in the module along with its dependencies you would have already got them at the same versions defined in the distro’s properties file anyways unless there is other properties in that file that you need.
importing my aijar module does not bring in all the dependencies as I have found that I need to add legacyui and uiframework modules in the new custom module
I need to expend the distro.properties so that I can create and manage SDK servers with different distributions like -Ddistro=org.openmrs.module:custommodule:1.0.0-SNAPSHOT which may include any additional modules not included in the aijar distribution that I call via the distribution -Ddistro=org.openmrs.aijar:2.0.1-SNAPSHOT
The default scope is compile if you don’t specify one and that includes the dependencies in the generated omod.
You could also add a properties file to the aijar module that has the details about the module and their versions via maven like here, that way this file is available on the classpath to your new dependent module.
Taking a step back, I thought the aijar module was the glue that brings everything together for your distribution, so why would you have another module depend on it? I’d think it would be the other way round.
But I like what you’re trying to do in general because for the ref app we maintain the module versions both in the refapp module and the distro which I think is bad given that the distro depends on ref app module anyways.
The aijar module is what brings everything together for the UgandaEMR - which is the base distribution
However we are finding instances where some speciality clinics need customizations on top of UgandaEMR for their needs, which are not used by everyone. So in this case we are looking to build custom modules for those implementations that need additional features.
In that case the clinic implementation would inherit all the modules, but add some that they deem necessary to solve their needs, hence the need for a distro.properties file named for the clinic so that they can build their own SDK Packages and servers.
Well in that I case what I have been saying wouldn’t make sense or work, maven dependencies and OpenMRS module dependencies are different concepts all together.
Somebody with better maven skills than I may suggest a better approach, if the aijar module is built like the ref app distro then I believe there is a way to do it. If you noticed, the ref app distro adds module dependencies for both the api and omod artifacts and actually only packages the omods in the generated archive, if aijar is setup in a similar way then including it as dependency in the other distro projects with type set to pom and possibly scope set to import (not sure if this is necessary but you can try it) should do the trick.
@ssmusoke, you can use a parent distro feature of SDK to inherit modules from another distro, which unfortunately hasn’t been documented on the wiki. Please see https://issues.openmrs.org/browse/SDK-185
Basically your base distro should publish a jar to maven containing openmrs-distro.properties on its root. Then you will be able to reference it in openmrs-distro.properties as
distro.yourdistro=version