Liquibase and PDE: Error Reading Migration File: Found 2 files that match /resources/changelog.xml
Asked Answered
P

0

7

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?

Pope answered 22/2, 2017 at 8:49 Comment(2)
No solution yet?Ginger
Similar problem in kubernetes context with some details https://mcmap.net/q/1629667/-liquibase-error-reading-changelog-file-found-2-files-that-match-liquibase-main-changelog-xml/12501050Coral

© 2022 - 2024 — McMap. All rights reserved.