1

Im my spring-boot application, when executing "mvn flyway:migrate" , I have the following exception:
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:6.4.1:migrate (default-cli) on project test-data-api: org.flywaydb.core.api.FlywayException: Unable to connect to the database. Configure the url, user and password!

Even when replacing the flyway placeholders (${flyway.url}, ${flyway.user}, ${flyway.user}) in the POM.XML file with Strings representing url, user and password, the above error occurs.

application.yaml:

flyway:
    url: jdbc:oracle:thin:@//xxxxxxxxx.ch:1521/yyyyy
    user: xxxx
    password: xxxxxxx

spring:
  flyway:
    url: jdbc:oracle:thin:@//xxxxxxxxx.ch:1521/yyyyy
    user: xxxx
    password: xxxxxxx

pom.xml

<build>
    <plugins>
        <plugin>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-maven-plugin</artifactId>
            <version>5.2.4</version>
            <configuration>
                <url>${flyway.url}</url>
                <user>${flyway.user}</user>
                <password>${flyway.password}</password>
            </configuration>
            <dependencies>
            <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>${oracle.version}</version>
            </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
user2023141
  • 895
  • 5
  • 17
  • 36
  • Does this answer your question? [Spring Boot FlywayException: Unable to connect to the database. Configure the url, user and password](https://stackoverflow.com/questions/64191935/spring-boot-flywayexception-unable-to-connect-to-the-database-configure-the-ur) – madteapot Apr 26 '21 at 09:49
  • No, none of the comments/suggestions in that thread worked. – user2023141 Apr 26 '21 at 12:41

1 Answers1

0

It seems that you are using an old version for the flyway-maven-plugin plugin. As of today the most recent version is 7.8.1

Try to use this version and see if the error still occurs.

RaduP
  • 119
  • 1
  • 5