Cannot find database driver: org.postgresql.Driver

I am trying to modify the project a bit by updating it with Liquibase. His project is Java EE. Thus, I am using the Liquibase-maven plugin.

So far I have in my pom.xml:

            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>2.0.5</version>
                <configuration>
                    <propertyFileWillOverride>true</propertyFileWillOverride>
                    <propertyFile>src/main/resources/liquibase.properties</propertyFile>
                    <changeLogFile>src/main/resources/changelogs/changelog.xml</changeLogFile>
                </configuration>
                <executions>
                    <execution>
                        <!--  Another Error: plugin execution not covered by lifecycle configuration..-->
                        <!-- <phase>process-resources</phase> <goals> <goal>update</goal> </goals> -->
                    </execution>
                </executions>
            </plugin>

which already contains the driver:

        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
        </dependency>

Liquibase.properties file has url, username, password, changeLogFile-Path and driver:

#liquibase.properties
driver: org.postgresql.Driver

But it does not have a class path for the driver. Do I need a way to classes?

The changelog.xml file has a simple set of changes that creates a table, just to check the campaigns to begin with.

But I didn’t go that far, because when I start a project with

mvn liquibase:update

Im getting this error:

[ERROR] org.liquibase: Liquibase-maven-plugin: 2.0.5: update (default-cli) PROJECT: Liquibase: java.lang.RuntimeException: : org.postgresql.Driver

. . , can not Liquibase ?

pom.xml, , :

            <configuration>
                <propertyFileWillOverride>true</propertyFileWillOverride>
                <propertyFile>src/main/resources/liquibase.properties</propertyFile>
                <changeLogFile>src/main/resources/changelogs/changelog.xml</changeLogFile>
                <driver>org.postgresql.Driver</driver>
            </configuration>

Liquibase.properties, .

, - , Liquibase.properties, .

+5
1

postgresql webapp. maven, , webapp. , JDBC ( , , plugty-maven-plugin):

<plugin>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-maven-plugin</artifactId>
    <version>2.0.5</version>
    <configuration>
        <propertyFileWillOverride>true</propertyFileWillOverride>
        <propertyFile>src/main/resources/liquibase.properties</propertyFile>
        <changeLogFile>src/main/resources/changelogs/changelog.xml</changeLogFile>
    </configuration>
    <executions>
        <execution>
            <!--  Another Error: plugin execution not covered by lifecycle configuration..-->
            <!-- <phase>process-resources</phase> <goals> <goal>update</goal> </goals> -->
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.1-901-1.jdbc4</version>
        </dependency>
    </dependencies>
</plugin>

Edit:

driver: org.postgresql.Driver driver=org.postgresql.Driver liquidibase.properties.

+9

All Articles