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>
2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.