I'm using Liquibase in OSGi bundle to update database. The problem is, when I start in in Eclipse, using PDE. I get then error:
liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 2 files that match /resources/changelog.xml
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:112)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:17)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:188)
at liquibase.Liquibase.update(Liquibase.java:181)
The resource is duplicated, because Eclipse adds project root to classpath, and maven build copies /resources/ directory to target/classes. Therefore, running in Eclipse, I have my changelog under /resources/changelog.xml
and /target/classes/resources/changelog.xml
. Not nice, but it's just how Eclipse works, and no great chance to do anything about it.
However, it is possible to force Liquibase to accept such not perfect circumstances, instead throwing exception?