我在多项目中有以下 build.gradle:
plugins {
id 'idea'
id 'eclipse'
id 'java'
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
test {
useJUnitPlatform()
minHeapSize = "2048m"
maxHeapSize = "6144m"
reports {
junitXml.enabled = true
html.enabled = true
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.6.0'
integrationTestRuntime 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
compile "org.seleniumhq.selenium:selenium-java:3.141.59"
} …Run Code Online (Sandbox Code Playgroud)