Flyway Failed to create jdbc driver instance

Just get started with Flyway and Spring 3.0. So far, all I did was add the Flyway dependency and plugin to my pom.xml. Then I tried to run mvn flyway:status on the command line. However, he complains that he cannot create an instance of the jdbc driver (I use postgres).

Does anyone know what could be causing this? I use the Springsource Tool Suite to develop my application. The postgres driver is located under WEB-INF / lib / postgresql-9.1-902.jdbc4.jar

Any help is much appreciated! Thanks!

+4
source share
3 answers

In order for the Maven plugin to work, you must:

Add this dependency to your project (or just a plugin):

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

and configure the plugin as follows:

 <plugin> <groupId>com.googlecode.flyway</groupId> <artifactId>flyway-maven-plugin</artifactId> <version>1.7</version> <configuration> <driver>org.postgresql.Driver</driver> <url>jdbc:postgresql://...</url> <user>...</user> <password>...</password> </configuration> </plugin> 
+7
source

You must also provide Postgresql jdbc drivers as a maven dependency:

 <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.1-902.jdbc4</version> </dependency> 
0
source

You can remove the following <dependencyManagement> tag! You can replace it with <dependence> I had this problem before and now it works well ... :)

-2
source

Source: https://habr.com/ru/post/1432004/


All Articles