Maven issue in modules

I ran into an issue with a module I was working on and came to realize that we possibly don’t need this, it’s what tells maven to extract/unpack files from the matched artifacts and include them in the generated omod, this is the reason why we end up with resource files from the modules api sub project e.g the hbm,, liquibase files included twice i.e in the jar file and at the root of the omod.

Another problem with this which I was running into was that I had test files in the api sub project that I needed to re-use for tests in the omod sub project, so i had to add the api sub project’s test artifact as a dependency to the omod as shown here, what ended up happening was that maven extracted all test classes and resources from the api jar into the omod and they get shipped along with the module which can cause all sorts of obscure bugs, the quick fix was to add a line that tells maven to exclude the dependencies with type set to test-jar from the dependencies it unpacks into the omod, but I also realized it’s probably better to just get rid of the entire execution that unpacks dependencies which will solve all the issues including the first one.

It would be nice to update the openmrs module wizard to have this fix that way the SDK is up to date.

In the first case “Fetch SASS sources from uicommons” I’m assuming that that line is only meant to pull in the external SASS from the uicommons module (so that modules that have SASS files that depend on the uicommons SASS can compile their css properly). If it is including other files as well, that would seem to be a problem.

Also, for what it’s worth, “src/main/compass/sass-external” shouldn’t be included in the packaged api or omod either (no idea if it is). This is simply to allow a module to compile and build it’s css properly.


Sorry i made a commit to the pom file so the line numbers are off and pointing to the wrong code, i have updated the first link in my original post, here is the correct one

Ah, okay :slight_smile: Yeah, I was a little confused.


Pinging @raff

@wyclif, searching for messages and liquibase in module’s api was fixed long enough ago in openmrs-core, see [issue link here] (I would link the issue if only JIRA wasn’t that slow right now) so we are safe to remove those lines in modules.

I’ll fix that in the module archetype in SDK.

I think I’ve seen the ticket and PR before you’re referring to, thanks @raff