maven - Liquibase : Cannot find base path 'src/main/resources/com/example/database/changelog/v000/master.xml' -
i trying build liquibase project using maven pluging, facing problem using relativefile paths, tried near best practices defined liquibase maven project. when run mvn liquibase:update, getting "cannont find base path".
src/ `-- main |-- java `-- resources |-- changelog-1.0.0.xml |-- changelog-1.1.0.xml |-- changelog-install.xml |-- com | `-- obolus | `-- database | `-- changelog | |-- v000 | | |-- cst | | | |-- entity_extra_data.xml | | | `-- entity.xml | | |-- master.xml | | `-- tab | | |-- company.xml | | |-- entity_extra_data.xml | | |-- entity.xml | | `-- anothertable.xml | `-- v001 | |-- master.xml | `-- tab | `-- sample.xml |-- lib | |-- ojdbc6-11.2.0.3.jar `-- liquibase.properties
content of pom.xml
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.obolus</groupid> <artifactid>database</artifactid> <version>1.0.0-snapshot</version> <packaging>jar</packaging> <build> <plugins> <plugin> <groupid>org.liquibase</groupid> <artifactid>liquibase-maven-plugin</artifactid> <version>${liquibase.maven.plugin}</version> <configuration> <changelogfile>src/main/resources/changelog-install.xml</changelogfile> <propertyfile>src/main/resources/liquibase.properties</propertyfile> <logging>${loglevel}</logging> </configuration> <executions> <execution> <goals> <goal>status</goal> </goals> </execution> </executions> </plugin> </plugins> <!-- resource filtering --> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> </build> <dependencies> <dependency> <groupid>com.oracle</groupid> <artifactid>ojdbc6</artifactid> <version>${ojdbc.driver.version}</version> </dependency> </dependencies> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <ojdbc.driver.version>11.2.0.3</ojdbc.driver.version> <liquibase.maven.plugin>3.3.2</liquibase.maven.plugin> <loglevel>severe</loglevel> </properties> </project>
when run liquibase:update, following error
debug 4/29/15 4:02 pm: liquibase: using file opener includeall: liquibase.resource.compositeresourceaccessor(org.liquibase.maven.plugins.mavenresourceaccessor(file:/home/www-data/workspace/database/target/classes/,file:/home/www-data/workspace/database/target/test-classes/,file:/home/www-data/.m2/repository/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar),liquibase.resource.filesystemresourceaccessor(/home/www-data/workspace/database)) debug 4/29/15 4:02 pm: liquibase: release database lock debug 4/29/15 4:02 pm: liquibase: executing update database command: update databasechangeloglock set locked = 0, lockedby = null, lockgranted = null id = 1 info 4/29/15 4:02 pm: liquibase: released change log lock [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 6.111 s [info] finished at: 2015-04-29t16:02:15+10:00 [info] final memory: 10m/164m [info] ------------------------------------------------------------------------ [error] failed execute goal org.liquibase:liquibase-maven-plugin:3.3.2:update (default-cli) on project database: error setting or running liquibase: liquibase.exception.setupexception: liquibase.exception.setupexception: liquibase.exception.setupexception: cannot find base path 'src/main/resources/com/example/database/changelog/v000/master.xml' -> [help 1]
any idea wrong.
it seems working after following changes.
chagne in pom.xml
<changelogfile>target/classes/changelog-install.xml</changelogfile <propertyfile>target/classes/liquibase.properties</propertyfile>
change in com.obolus.database.changelog.v000/master.xml
<includeall path="com/obolus/database/changelog/v000/tab"/> <includeall path="com/obolus/database/changelog/v000/cst"/>
Comments
Post a Comment