Closed nicolasgnr closed 8 years ago
I'm not a Maven expert, but my guess is that the problem is related to the classpath. The liquibase-groovy-dsl does not need to be in the classpath of the project, but it does need to be in the classpath of the build.
In Gradle, there is a difference between the classpath used for calculating project dependencies/generating project POMS, and the classpath used by gradle itself when executing tasks. I'm betting that Maven has the same.
In your case, declaring the dependency where you have tells Maven that it needs liquibase-groovy-dsl to compile the project (it doesn't), but it probably doesn't tell maven that it needs to be in the classpath when it executes the liquibase-maven-plugin.
You can probably fix the problem by telling Maven to include liquibase-groovy-dsl in its own classpath when it executes plugins. Probably somewhere in the <build>
or <plugins>
sections.
Sorry I couldn't be more specific.
Hi! Thanks for the answer. I've resolved the problem by adding the dependency to the specific plugin such like this:
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>${liquibase.version}</version>
<configuration>
<changeLogFile>src/main/resources/liquibase/masterChangelog.groovy</changeLogFile>
<propertyFile>db.properties</propertyFile>
</configuration>
<dependencies>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-groovy-dsl</artifactId>
<version>${liquibase-groovy.version}</version>
</dependency>
</dependencies>
</plugin>
Thank you for including the snippet from your pom file. It will help others who run into the same problem.
I'm having a problem when executing the update goal. I get the following error:
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.1:update (default) on project liquibase-sample-mvn: Error setting up or running Liquibase: Cannot find parser that supports src/main/resources/liquibase/masterChangelog.groovy -> [Help 1]
For some reason the GroovyLiquibaseChangeLogParser is not been registered in the ChangeLogParserFactory. When I inspect the parsers a cannot see the groovy one.
Here is my pom.xml:
Any ideas?