1 Star 0 Fork 14

徐旭/Gitee Go Gradle 使用示例

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
XiaoXuxuy 提交于 2022-03-23 19:02 . 单元测试
plugins {
id 'org.springframework.boot' version '2.5.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'jacoco'
}
group = 'com.shamgod'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
test {
// 使用spring junit5测试需要这个
useJUnitPlatform()
jacoco {
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
jacoco {
toolVersion = "0.8.7"
reportsDir = file("$buildDir/customJacocoReportDir")
}
jacocoTestReport {
reports {
html.enabled true
csv.enabled false
xml.enabled true
xml.destination file("$buildDir/jacocoXml.xml")
html.destination file("$buildDir/jacocoHtml")
}
afterEvaluate {
getClassDirectories().setFrom(
classDirectories.files.collect {
fileTree(dir: it,
exclude: ['需要排除的路径, it路径是classes'])
}
)
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/XiaoXuxuy/spring-gradle.git
git@gitee.com:XiaoXuxuy/spring-gradle.git
XiaoXuxuy
spring-gradle
Gitee Go Gradle 使用示例
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385