You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.8 KiB

plugins {
id 'java'
id 'war'
id 'org.springframework.boot' version '3.2.0'
id 'io.spring.dependency-management' version '1.1.4'
}
group = 'com.smartlibrary'
version = '1.0.0'
// 支持Jenkins构建号
def buildNumber = project.findProperty('buildNumber') ?: '0'
def fullVersion = "v${version}.${buildNumber}"
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
repositories {
mavenCentral()
}
dependencies {
implementation project(':core')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// 测试依赖
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito:mockito-core:5.8.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.8.0'
}
tasks.named('test') {
useJUnitPlatform()
// 生成测试报告
testLogging {
events "passed", "skipped", "failed"
showStandardStreams = true
}
reports {
html.required = true
junitXml.required = true
}
finalizedBy jacocoTestReport
}
// JaCoCo 代码覆盖率
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.11"
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
}
}
bootJar {
archiveBaseName = 'mcslms-backend'
archiveVersion = fullVersion
manifest {
attributes(
'Implementation-Title': 'Smart Library Backend',
'Implementation-Version': fullVersion
)
}
}
bootWar {
archiveBaseName = 'mcslms-web'
archiveVersion = fullVersion
manifest {
attributes(
'Implementation-Title': 'Smart Library Web',
'Implementation-Version': fullVersion
)
}
}