Flyway maven 配置

0
(0)

pom.xml 中增加配置:

    <build>
        <plugins>
            <plugin>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-maven-plugin</artifactId>
                <version>9.17.0</version>
                <configuration>
                    <url>${url}</url>
                    <user>${user}</user>
                    <password>${password}</password>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.flywaydb</groupId>
                        <artifactId>flyway-mysql</artifactId>
                        <version>9.21.0</version>
                    </dependency>
                    <dependency>
                        <groupId>com.mysql</groupId>
                        <artifactId>mysql-connector-j</artifactId>
                        <version>8.0.32</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

假设我这个pom在 db-flyway的 moudle 里,-pl 的参数是为了指定mvn命令的执行目录为db-flyway模块:

mvn flyway:migrate -pl db-flyway -Durl=jdbc:mysql://localhost:3306/dbname -Duser=root -Dpassword=12345678

这篇文章有用吗?

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位评论此文章。

很抱歉,这篇文章对您没有用!

让我们改善这篇文章!

告诉我们我们如何改善这篇文章?


了解 工作生活心情记忆 的更多信息

Subscribe to get the latest posts sent to your email.