如何使用Maven pom.xml中的application.conf文件进行飞行路线配置

时间:2018-06-21 15:01:31

标签: scala maven typesafe

    <plugin>
    <groupId>com.googlecode.flyway</groupId>
    <artifactId>flyway-maven-plugin</artifactId>
    <version>1.7</version>
    <configuration>
        <driver>com.mysql.jdbc.Driver</driver>
        <url>jdbc:mysql://127.0.0.1:3306/db_abc</url>
        <user>db_user</user>
        <sqlMigrationPrefix>V</sqlMigrationPrefix>
    </configuration>
</plugin>

我不想在这里提及驱动程序,URL和用户。我已经在src / main / resources上有一个resources.conf。如何在这里使用该文件?

1 个答案:

答案 0 :(得分:0)

<plugin>
<groupId>com.googlecode.flyway</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
    <driver>com.mysql.jdbc.Driver</driver>
    <url>jdbc:mysql://127.0.0.1:3306/db_abc</url>
    <user>db_user</user>
    <sqlMigrationPrefix>V</sqlMigrationPrefix>
</configuration>
<configFiles>
    <configFile>myConfig.conf</configFile>
</configFiles>
</plugin>

来自Flyway文档:https://flywaydb.org/documentation/maven/migrate

myConfig.conf:

flyway.url=jdbc:mysql://127.0.0.1:3306/db_abc

请参阅有关飞行通道配置文件的文档:https://flywaydb.org/documentation/configfiles