Skip to content
Snippets Groups Projects
Commit f08d251a authored by Mingyuan Chen's avatar Mingyuan Chen
Browse files

Update build.gradle

parent b158c033
No related branches found
No related tags found
No related merge requests found
...@@ -13,18 +13,29 @@ test { ...@@ -13,18 +13,29 @@ test {
} }
} }
jacoco {
toolVersion = "0.8.10" // 确保设置版本,Jenkins 有时会要求
}
jacocoTestReport { jacocoTestReport {
dependsOn test // ⚠️ 一定要先执行测试任务 dependsOn test
reports { reports {
xml.required = true xml.required = true
html.required = true html.required = true
csv.required = false
xml.outputLocation = layout.buildDirectory.file("reports/jacoco/test/jacocoTestReport.xml")
} }
// 确保 Jenkins 能找到 class 和 source 路径
classDirectories.setFrom(fileTree("${buildDir}/classes/java/main"))
sourceDirectories.setFrom(files("src/main/java"))
executionData.setFrom(fileTree(buildDir).include("/jacoco/test.exec"))
} }
group = 'com.cardiff.client_project' group = 'com.cardiff.client_project'
version = '0.0.1-SNAPSHOT' version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17' sourceCompatibility = '17'
configurations { configurations {
compileOnly { compileOnly {
...@@ -49,16 +60,11 @@ dependencies { ...@@ -49,16 +60,11 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
//implementation 'org.seleniumhq.selenium:selenium-java:4.8.0'
testImplementation("io.github.bonigarcia:webdrivermanager:5.2.0") testImplementation("io.github.bonigarcia:webdrivermanager:5.2.0")
testImplementation group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.32' testImplementation group: 'net.sourceforge.htmlunit', name: 'htmlunit', version: '2.32'
testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.1.0' testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.1.0'
} }
tasks.named('test') { tasks.named('test') {
useJUnitPlatform() useJUnitPlatform()
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment