Using a Parent POM

We have been successfully using Liquibase 2.0 RC2 for the past few months on our project. Now we have come to a stage where it makes sense to split our project into a core and several web applications. We want the Liquibase Maven Plugin to run for each module, so we left the plugin configuration in the parent POM unchanged. However, now the plugin complains that it cannot find the properties file. It is as if the classpath does not include src/main/resources anymore. If we explicitly give the path to the properties file, e.g. src/main/resources/, it is found, but then it cannot find the change log file. If we prepend src/main/resources/ to the change log file path, it is found, but then the migration files cannot be found. All these files were specified relative to src/main/resources before and it worked flawlessly. Do you have any suggestions?

      org.liquibase   liquibase-maven-plugin   2.0-rc2-SNAPSHOT             process-resources              false                     update            
    [INFO] [liquibase:update {execution: default}] [INFO] ------------------------------------------------------------------------ [INFO] Parsing Liquibase Properties File [INFO]  File: [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Failed to resolve the properties file. [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.BuildFailureException: Failed to resolve the properties file. at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle( at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal( at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures( at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( at org.apache.maven.DefaultMaven.doExecute( at org.apache.maven.DefaultMaven.execute( at org.apache.maven.cli.MavenCli.main( at org.apache.maven.cli.compat.CompatibleMain.main( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( at sun.reflect.DelegatingMethodAccessorImpl.invoke( at java.lang.reflect.Method.invoke( at org.codehaus.classworlds.Launcher.launchEnhanced( at org.codehaus.classworlds.Launcher.launch( at org.codehaus.classworlds.Launcher.mainWithExitCode( at org.codehaus.classworlds.Launcher.main( Caused by: org.apache.maven.plugin.MojoFailureException: Failed to resolve the properties file. at org.liquibase.maven.plugins.AbstractLiquibaseMojo.configureFieldsAndValues( at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute( at org.apache.maven.plugin.DefaultPluginManager.executeMojo( at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals( ... 17 more

Hi, I’m using parent POM

do copy all the files to the target/classes directory and use it as base dir.

in my case parent POM section:

    src/main/liquibase ${basedir}/src/main/liquibase **/*.xml **/*.sql **/*.csv ...

this trick make all liquibase-related files accessible at maven runtime.

Cheers, Oleg

Hi @taranenko,

I did not understand your solution. Are you saying to copy all the files and changelogs into the target/classes folder?