當gradlew運行flywayRepair或flywayMigrate,返回狀態始終爲0(零),不管成功還是失敗的:gradlew沒有返回飛行用命令的錯誤狀態
./gradlew --quiet -Pflyway.initOnMigrate=true -Pflyway.url=jdbc:mysql://localhost:3306/mars flywayRepair
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':common:flywayRepair'.
> Error occurred while executing flywayRepair
Unable to obtain Jdbc connection from DataSource (jdbc:mysql://localhost:3306/mars) for user 'flyaway'
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Connection refused
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Exit status from flywayRepair for mars is 0
無法重現。你是否說「退火狀態從flywayRepair for mars是0」是輸出的一部分,是問題所在?或者你在談論'gradle'命令的實際退出狀態? – 2014-11-06 10:08:04
「我的shell腳本調用gradle任務時發出」退出狀態從fltwat修復mars爲0「。我將跟進並鏈接到腳本示例 – 2014-11-07 06:45:25
聽起來像是您的shell腳本的問題。發生故障的Gradle內部版本的退出狀態爲1. – 2014-11-07 06:59:52