flyway maven plugin无法正常使用: Unable to connect to the database. Configure the url, user and password!...

在pom.xml依赖中添加configuration内容,如下:

<plugin>
				<groupId>org.flywaydb</groupId>
				<artifactId>flyway-maven-plugin</artifactId>
				<version>4.2.0</version>
				<!--	configuration配置 url,user,password不然plugin无法正常使用			-->
				<configuration>
					<url>jdbc:mysql://localhost:3306/scis?useUnicode=true&amp;zeroDateTimeBehavior=convertToNull&amp;autoReconnect=true&amp;characterEncoding=utf-8&amp;serverTimezone=CTT</url>
					<user>root</user>
					<password>123456</password>
				</configuration>
			</plugin>

测试flyway info执行结果:

"C:\Program Files\Java\jdk1.8.0_231\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\springgw\scis-master -Dmaven.home=D:\apache-maven-3.6.3 -Dclassworlds.conf=D:\apache-maven-3.6.3\bin\m2.conf "-Dmaven.ext.class.path=D:\IntelliJ IDEA 2020.1.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:D:\IntelliJ IDEA 2020.1.2\lib\idea_rt.jar=57367:D:\IntelliJ IDEA 2020.1.2\bin" -Dfile.encoding=UTF-8 -classpath D:\apache-maven-3.6.3\boot\plexus-classworlds-2.6.0.jar;D:\apache-maven-3.6.3\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version2020.1.2 -s D:\apache-maven-3.6.3\conf\settings.xml -Dmaven.repo.local=D:\apache-maven-3.6.3\repository org.flywaydb:flyway-maven-plugin:4.2.0:info
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------------< com.jcohy:scis >---------------------------
[INFO] Building scis 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- flyway-maven-plugin:4.2.0:info (default-cli) @ scis ---
[INFO] Flyway 4.2.0 by Boxfuse
Thu Jul 09 09:13:11 GMT+08:00 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
[INFO] Database: jdbc:mysql://rm-2zed2d1o5ujtu72g7no.mysql.rds.aliyuncs.com:3306/scis?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=utf-8&serverTimezone=CTT (MySQL 8.0)
[INFO] 
+------------------+------------------------+---------------------+---------+
| Version          | Description            | Installed on        | State   |
+------------------+------------------------+---------------------+---------+
| 1.0.0.20180406.1 | SCIS DB INIT           | 2020-06-29 14:46:08 | Success |
| 1.0.0.20180407.1 | ADD  TABLE ALLOTPRO    | 2020-06-29 14:46:10 | Success |
| 1.0.0.20180410.2 | ADD  TABLE Notice      | 2020-06-29 14:46:11 | Success |
| 1.0.0.20180416.1 | ADD  TABLE FIELD       | 2020-06-29 14:46:13 | Success |
| 1.0.0.20180416.2 | ADD  SOME DATA         | 2020-06-29 14:46:16 | Success |
| 1.0.0.20180510.1 | ADD  TABLE CIRCULAR    | 2020-06-29 14:46:18 | Success |
| 1.0.0.20180510.2 | ADD  TABLE FIELD       | 2020-06-29 14:46:19 | Success |
| 1.0.0.20180510.3 | ADD  TABLE FIELD       | 2020-06-29 14:46:20 | Success |
| 1.0.0.20180517.1 | ADD  TABLE FIELD       | 2020-06-29 14:46:21 | Success |
| 1.0.0.20180517.2 | ADD  FORGIN KEY        | 2020-06-29 14:46:23 | Success |
| 1.0.0.20180517.3 | CHANGE  CIRCULAR FIELD | 2020-06-29 14:46:24 | Success |
| 1.0.0.20180518.1 | ADD PROJECT DATE       | 2020-06-29 14:46:26 | Success |
| 1.0.0.20180522.1 | DELETE PROJECT FIELD   | 2020-06-29 14:46:27 | Success |
| 1.0.0.20180524.1 | CHANGE  NUM FIELD      | 2020-06-29 14:46:29 | Success |
| 1.0.0.20180525.1 | ADD DEPT FIELD         | 2020-06-29 14:46:31 | Success |
| 1.0.0.20180527.1 | ADD DEPT FIELD         | 2020-06-29 14:46:33 | Success |
| 2.0.0.20200708.1 | SCIS DB INIT           | 2020-07-08 17:50:50 | Success |
+------------------+------------------------+---------------------+---------+

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.237 s
[INFO] Finished at: 2020-07-09T09:13:12+08:00
[INFO] ------------------------------------------------------------------------
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

人生莫如饥荒

如果对您有帮助,也可以给点赏钱

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值