I’ve been looking at this issue, to update to a newer version of Liquibase, and have gotten somewhere with it, but I’m getting bitten by this issue in Liquibase itself. Basically, since 3.2.0, Liquibase throws an exception when two files of the same name are found on the classpath.
Ultimately, this causes almost every module to fail assuming they use the standard conventions of putting the liquibase.xml file in the API module, because the liquibase.xml ends up in both the OMOD and the API jar and so is found twice on the code path.
There are five kinds of fixes that occur to me:
In every module, move the liquibase.xml file to the omod module rather than the api module. We could somewhat automate this using the Maven plugin.
Update the Maven plugin to not copy the liquibase.xml file to the omod, since the liquibase.xml file can be loaded from the API jar.
Some sort of change to
ModuleClassLoader#isResourceVisible()to ensure that only one copy of liquibase.xml is visible at a time.
Targeting Liquibase 3.1.1, which is at least an update and doesn’t have this issue.
Waiting on Liquibase 4.0.0, which also doesn’t have this issue, but whose release time frame is unclear.
1 and 2 are likely impractical because though we could fix things for the Ref App, it will cause breakages in distributions. 3 lets us update, but feels a bit hackish to me.
I was hoping the community might have some opinions on the best way forward with this.