2020-01-10 21:48:43 +08:00
|
|
|
plugins {
|
2020-01-23 03:24:37 +08:00
|
|
|
id "java-gradle-plugin"
|
|
|
|
id "io.spring.javaformat" version "${javaFormatVersion}"
|
|
|
|
id "checkstyle"
|
2022-09-08 06:51:53 +08:00
|
|
|
id "eclipse"
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
gradlePluginPortal()
|
|
|
|
}
|
|
|
|
|
2023-10-11 17:59:25 +08:00
|
|
|
sourceCompatibility = 17
|
|
|
|
targetCompatibility = 17
|
2023-10-11 17:29:36 +08:00
|
|
|
|
|
|
|
def versions = [:]
|
|
|
|
new File(projectDir.parentFile, "gradle.properties").withInputStream {
|
2023-05-05 15:16:37 +08:00
|
|
|
def properties = new Properties()
|
|
|
|
properties.load(it)
|
2023-10-11 17:29:36 +08:00
|
|
|
["assertj", "commonsCodec", "hamcrest", "jackson", "junitJupiter",
|
2023-10-11 18:27:37 +08:00
|
|
|
"kotlin", "maven"].each {
|
2023-10-11 17:29:36 +08:00
|
|
|
versions[it] = properties[it + "Version"]
|
|
|
|
}
|
|
|
|
}
|
2023-10-11 18:27:37 +08:00
|
|
|
versions["springFramework"] = "6.0.12"
|
2023-10-11 17:29:36 +08:00
|
|
|
ext.set("versions", versions)
|
|
|
|
if (versions.springFramework.contains("-")) {
|
|
|
|
repositories {
|
|
|
|
maven { url "https://repo.spring.io/milestone" }
|
|
|
|
maven { url "https://repo.spring.io/snapshot" }
|
2022-06-15 01:58:16 +08:00
|
|
|
}
|
|
|
|
}
|
2023-05-05 15:16:37 +08:00
|
|
|
|
2024-01-10 01:06:53 +08:00
|
|
|
checkstyle {
|
|
|
|
toolVersion = "10.12.4"
|
|
|
|
}
|
|
|
|
|
2020-01-10 21:48:43 +08:00
|
|
|
dependencies {
|
2024-01-10 01:06:53 +08:00
|
|
|
checkstyle("com.puppycrawl.tools:checkstyle:${checkstyle.toolVersion}")
|
|
|
|
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}")
|
2023-05-02 15:40:58 +08:00
|
|
|
|
2023-10-11 17:29:36 +08:00
|
|
|
implementation(platform("org.springframework:spring-framework-bom:${versions.springFramework}"))
|
2022-09-06 21:09:28 +08:00
|
|
|
implementation("com.diffplug.gradle:goomph:3.37.2")
|
2023-10-11 17:29:36 +08:00
|
|
|
implementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
|
2024-04-26 16:04:20 +08:00
|
|
|
implementation("com.gradle:develocity-gradle-plugin:3.17.2")
|
2022-11-17 02:09:10 +08:00
|
|
|
implementation("com.tngtech.archunit:archunit:1.0.0")
|
2023-10-11 17:29:36 +08:00
|
|
|
implementation("commons-codec:commons-codec:${versions.commonsCodec}")
|
2023-10-11 18:44:26 +08:00
|
|
|
implementation("de.undercouch.download:de.undercouch.download.gradle.plugin:5.5.0")
|
2023-05-02 15:40:58 +08:00
|
|
|
implementation("io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}")
|
2023-10-11 17:29:36 +08:00
|
|
|
implementation("org.apache.maven:maven-embedder:${versions.maven}")
|
2024-04-26 21:30:37 +08:00
|
|
|
implementation("org.asciidoctor:asciidoctor-gradle-jvm:4.0.2")
|
2023-10-11 17:29:36 +08:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}")
|
|
|
|
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:${versions.kotlin}")
|
2023-05-02 15:40:58 +08:00
|
|
|
implementation("org.springframework:spring-context")
|
2022-01-24 22:19:47 +08:00
|
|
|
implementation("org.springframework:spring-core")
|
|
|
|
implementation("org.springframework:spring-web")
|
2023-05-02 15:40:58 +08:00
|
|
|
|
2023-10-11 17:29:36 +08:00
|
|
|
testImplementation("org.assertj:assertj-core:${versions.assertj}")
|
|
|
|
testImplementation("org.hamcrest:hamcrest:${versions.hamcrest}")
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter:${versions.junitJupiter}")
|
2023-09-07 00:20:00 +08:00
|
|
|
testImplementation("org.springframework:spring-test")
|
2023-05-02 15:40:58 +08:00
|
|
|
|
2021-05-19 04:24:39 +08:00
|
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gradlePlugin {
|
|
|
|
plugins {
|
2020-07-03 00:38:13 +08:00
|
|
|
annotationProcessorPlugin {
|
|
|
|
id = "org.springframework.boot.annotation-processor"
|
|
|
|
implementationClass = "org.springframework.boot.build.processors.AnnotationProcessorPlugin"
|
|
|
|
}
|
2022-11-15 19:24:27 +08:00
|
|
|
architecturePlugin {
|
2023-10-11 17:29:36 +08:00
|
|
|
id = "org.springframework.boot.architecture"
|
|
|
|
implementationClass = "org.springframework.boot.build.architecture.ArchitecturePlugin"
|
2022-11-15 19:24:27 +08:00
|
|
|
}
|
2020-01-10 21:48:43 +08:00
|
|
|
autoConfigurationPlugin {
|
|
|
|
id = "org.springframework.boot.auto-configuration"
|
|
|
|
implementationClass = "org.springframework.boot.build.autoconfigure.AutoConfigurationPlugin"
|
|
|
|
}
|
|
|
|
bomPlugin {
|
|
|
|
id = "org.springframework.boot.bom"
|
|
|
|
implementationClass = "org.springframework.boot.build.bom.BomPlugin"
|
|
|
|
}
|
|
|
|
configurationPropertiesPlugin {
|
|
|
|
id = "org.springframework.boot.configuration-properties"
|
|
|
|
implementationClass = "org.springframework.boot.build.context.properties.ConfigurationPropertiesPlugin"
|
|
|
|
}
|
|
|
|
conventionsPlugin {
|
|
|
|
id = "org.springframework.boot.conventions"
|
|
|
|
implementationClass = "org.springframework.boot.build.ConventionsPlugin"
|
|
|
|
}
|
|
|
|
deployedPlugin {
|
|
|
|
id = "org.springframework.boot.deployed"
|
|
|
|
implementationClass = "org.springframework.boot.build.DeployedPlugin"
|
|
|
|
}
|
2024-06-25 17:50:29 +08:00
|
|
|
dockerTestPlugin {
|
|
|
|
id = "org.springframework.boot.docker-test"
|
|
|
|
implementationClass = "org.springframework.boot.build.test.DockerTestPlugin"
|
|
|
|
}
|
2020-01-10 21:48:43 +08:00
|
|
|
integrationTestPlugin {
|
|
|
|
id = "org.springframework.boot.integration-test"
|
|
|
|
implementationClass = "org.springframework.boot.build.test.IntegrationTestPlugin"
|
|
|
|
}
|
2021-07-09 05:23:43 +08:00
|
|
|
systemTestPlugin {
|
|
|
|
id = "org.springframework.boot.system-test"
|
|
|
|
implementationClass = "org.springframework.boot.build.test.SystemTestPlugin"
|
|
|
|
}
|
2020-01-10 21:48:43 +08:00
|
|
|
mavenPluginPlugin {
|
|
|
|
id = "org.springframework.boot.maven-plugin"
|
|
|
|
implementationClass = "org.springframework.boot.build.mavenplugin.MavenPluginPlugin"
|
|
|
|
}
|
|
|
|
mavenRepositoryPlugin {
|
|
|
|
id = "org.springframework.boot.maven-repository"
|
|
|
|
implementationClass = "org.springframework.boot.build.MavenRepositoryPlugin"
|
|
|
|
}
|
|
|
|
optionalDependenciesPlugin {
|
|
|
|
id = "org.springframework.boot.optional-dependencies"
|
|
|
|
implementationClass = "org.springframework.boot.build.optional.OptionalDependenciesPlugin"
|
|
|
|
}
|
2022-09-06 21:09:28 +08:00
|
|
|
processedAnnotationsPlugin {
|
|
|
|
id = "org.springframework.boot.processed-annotations"
|
|
|
|
implementationClass = "org.springframework.boot.build.processors.ProcessedAnnotationsPlugin"
|
|
|
|
}
|
2020-01-10 21:48:43 +08:00
|
|
|
starterPlugin {
|
|
|
|
id = "org.springframework.boot.starter"
|
|
|
|
implementationClass = "org.springframework.boot.build.starters.StarterPlugin"
|
|
|
|
}
|
2020-01-17 04:55:20 +08:00
|
|
|
testFailuresPlugin {
|
|
|
|
id = "org.springframework.boot.test-failures"
|
|
|
|
implementationClass = "org.springframework.boot.build.testing.TestFailuresPlugin"
|
|
|
|
}
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
2022-09-08 06:51:53 +08:00
|
|
|
|
|
|
|
eclipse.classpath.file.whenMerged {
|
|
|
|
def jreEntry = entries.find { it.path.contains("org.eclipse.jdt.launching.JRE_CONTAINER") }
|
|
|
|
jreEntry.entryAttributes['module'] = 'true'
|
|
|
|
jreEntry.entryAttributes['limit-modules'] = 'java.base'
|
|
|
|
}
|
|
|
|
|