确保我的自定义Gradle配置获得所需的依赖项
我在gradle中设置了一个集成测试任务,如下所示:确保我的自定义Gradle配置获得所需的依赖项,gradle,Gradle,我在gradle中设置了一个集成测试任务,如下所示: sourceSets { main { output.resourcesDir = output.classesDir } integrationTest { java.srcDirs = ['src/it/java'] resources.srcDirs = ['src/it/resources', 'src/main/resources'] com
sourceSets {
main {
output.resourcesDir = output.classesDir
}
integrationTest {
java.srcDirs = ['src/it/java']
resources.srcDirs = ['src/it/resources', 'src/main/resources']
compileClasspath = sourceSets.main.output + configurations.testRuntime
runtimeClasspath = output + compileClasspath
}
}
task integrationTest(type: Test) {
description "Run the integration tests."
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
reports.html.destination = file("$reports.html.destination/integration")
reports.junitXml.destination = file("$reports.junitXml.destination/integration")
}
但当我试图查看这些配置的依赖项时(即integrationTestCompile
和integrationTestRuntime
),它们似乎是空的:
./gradlew bignibou-server:dependencies
integrationTest
No dependencies
integrationTestCompile - Compile classpath for source set 'integration test'.
No dependencies
integrationTestRuntime - Runtime classpath for source set 'integration test'.
No dependencies
我不确定如何指定我的集成测试依赖项
这不起作用:
// Testing
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.springframework.security:spring-security-test:${springSecurityVersion}")
testCompile("org.mockito:mockito-core:${mockitoVersion}")
testCompile("org.hamcrest:hamcrest-core:${hamcrestVersion}")
testCompile("org.easytesting:fest-assert:${festVersion}")
testCompile("com.h2database:h2:${h2Version}")
testCompile("org.subethamail:subethasmtp:${wiserVersion}")
否则,依赖项将出现在上面
有人能帮忙吗