Hi there,

I am using the liquibase plugin and I keep getting the following error:


[ERROR] Failed to execute goal 
org.liquibase:liquibase-maven-plugin:2.0.3:update (default) on project 
dbmigration: Error setting up or running Liquibase: java.lang.RuntimeException: 
Cannot find database driver: org.postgresql.Driver -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.liquibase:liquibase-maven-plugin:2.0.3:update (default) on project 
dbmigration: Error setting up or running Liquibase: java.lang.RuntimeException: 
Cannot find database driver: org.postgresql.Driver


I am configuring the liquibase plugin as follows:



<build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>2.3.2</version>
                                <configuration>
                                        <source>1.6</source>
                                        <target>1.6</target>
                                </configuration>
                        </plugin>
                        <plugin>
                                <groupId>org.liquibase</groupId>
                                <artifactId>liquibase-maven-plugin</artifactId>
                                <version>2.0.3</version>
                                <executions>
                                        <execution>
                                                <phase>process-resources</phase>
                                                <goals>
                                                        <goal>update</goal>
                                                </goals>
                                        </execution>
                                </executions>
                                <dependencies>
                                        <dependency>
                                                <groupId>postgresql</groupId>
                                                
<artifactId>postgresql</artifactId>
                                                <version>9.0-801.jdbc4</version>
                                        </dependency>
                                </dependencies>
                                <configuration>
                                        
<changeLogFile>db/changelog-master.xml</changeLogFile>
                                        <driver>org.postgresql.Driver</driver>
                                        <url>jdbc:someurl</url>
                                        <username>mojiva</username>
                                        <password>mojiva</password>
                                        
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
                                        <contexts>main</contexts>
                                </configuration>
                        </plugin>
                </plugins>
            </build>

and the following dependency is part of my project:






        <dependencies>
               <dependency>
<groupId>postgresql</groupId>
                        <artifactId>postgresql</artifactId>
                        <version>9.0-801.jdbc4</version>
                        <type>jar</type>
                        <scope>compile</scope>
                </dependency>
        </dependencies>


If I manually inspect the specified postgres jar, it does contain the class 
org.postgresql.Driver.

And if I run maven with debugging output turned on, it looks like the plugin's 
classpath contains that jar:

[DEBUG] Importing foreign packages into class realm 
plugin>org.liquibase:liquibase-maven-plugin:2.0.3
[DEBUG] Created new class realm 
plugin>org.liquibase:liquibase-maven-plugin:2.0.3
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>org.liquibase:liquibase-maven-plugin:2.0.3
[DEBUG]   Included: org.liquibase:liquibase-maven-plugin:jar:2.0.3
[DEBUG]   Included: postgresql:postgresql:jar:9.0-801.jdbc4
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG]   Included: org.liquibase:liquibase-core:jar:2.0.3
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG]   Excluded: junit:junit:jar:4.8.1
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2


Any help is very much appreciated!

John Kramer
email: [email protected]<mailto:[email protected]>


Reply via email to