运行Maven flyway插件
mvn flyway:migrate
使用此配置:
org.flywaydb
flyway-maven-plugin
4.0.3
com.mysql.jdbc
jdbc:mysql://localhost:3306/schema2?createDatabaseIfNotExist=true
root
root
从一个执行开始:
org.flywaydb
flyway-maven-plugin
4.0.3
migrate-database
compile
migrate
com.mysql.jdbc
jdbc:mysql://localhost:3306/schema2?createDatabaseIfNotExist=true
root
root
看到例外:
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:4.0.3:migrate (default-cli) on project UrbanLife: org.flywaydb.core.api.FlywayException: Unable to connect to the database. Configure the url, user and password! -> [Help 1]
看起来飞行路线看不到里面的配置
(有趣的是,在前面提到的链接中,它起作用了)
请帮助通过maven创建flyway multyDB集成.
解决方法:
如果您有多个(或只有一个)< execution>在您的maven插件配置中,并尝试从命令行运行特定执行,您需要按执行ID指定执行,例如您的情况
mvn flyway:migrate@migrate-database
最后,如果您希望特定的执行为默认执行,则可以按照these maven docs中的说明为它指定default-cli的执行ID.然后,您只需运行mvn flyway:migrate.
标签:maven,flyway,execution,java
来源: https://codeday.me/bug/20191026/1938026.html