我不太明白在Spring Boot项目中使用Flyway迁移失败时我应该做些什么.
我通过简单地添加Flyway依赖项来激活Flyway pom.xml.一切正常.启动Spring Boot应用程序时,将迁移我的数据库脚本.
但是我的一个脚本出错了,上一次迁移失败了.现在,当我尝试迁移时,存在"迁移校验和不匹配".通常,我会运行mvn flyway:repair,但由于我使用Spring Boot,我不应该使用Flyway Maven插件.那我该怎么办?
我正在尝试Gradle和jUnit5.除了我不能运行特定的jUnit测试之外,一切正常.当我右键单击测试类时,不会出现"运行'SampleTest'"选项.
我有最新版本的IntelliJ(2016.1.3)Ultimate.这是我的build.gradle档案:
repositories {
mavenCentral()
}
apply plugin: 'java'
version = '1.0.0-SNAPSHOT'
jar {
baseName = 'test-project'
}
dependencies {
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.0.0-M1'
}
Run Code Online (Sandbox Code Playgroud)
项目结构是标准结构(如Maven).这是一个测试的例子:
package com.test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class SampleTest {
@Test public void sampleTest() {
int test = 1;
Assertions.assertTrue(test == 1);
}
}
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
编辑:
Gradle似乎也没有接受我的测试.当我去build/reports/tests/index.html,它表示0测试.
最终编辑:
按照@ dunny的回答,这就是我所做的一切,让一切顺利.我build.gradle像这样修改了我的文件:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M1'
}
}
repositories {
mavenCentral() …Run Code Online (Sandbox Code Playgroud)