mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
198 lines
6.2 KiB
Groovy
198 lines
6.2 KiB
Groovy
plugins {
|
|
id "org.asciidoctor.jvm.convert"
|
|
id "org.springframework.boot.conventions"
|
|
id "org.springframework.boot.maven-plugin"
|
|
id "org.springframework.boot.optional-dependencies"
|
|
id "org.springframework.boot.docker-test"
|
|
}
|
|
|
|
description = "Spring Boot Maven Plugin"
|
|
|
|
configurations {
|
|
dependenciesBom
|
|
documentation
|
|
}
|
|
|
|
dependencies {
|
|
asciidoctorExtensions("io.spring.asciidoctor:spring-asciidoctor-extensions-section-ids")
|
|
|
|
compileOnly("org.apache.maven.plugin-tools:maven-plugin-annotations")
|
|
compileOnly("org.apache.maven:maven-core") {
|
|
exclude(group: "javax.annotation", module: "javax.annotation-api")
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
compileOnly("org.apache.maven:maven-plugin-api") {
|
|
exclude(group: "javax.annotation", module: "javax.annotation-api")
|
|
exclude(group: "javax.enterprise", module: "cdi-api")
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
|
|
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
|
|
dockerTestImplementation("org.apache.maven.shared:maven-invoker") {
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
dockerTestImplementation("org.assertj:assertj-core")
|
|
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
|
|
dockerTestImplementation("org.testcontainers:junit-jupiter")
|
|
dockerTestImplementation("org.testcontainers:testcontainers")
|
|
|
|
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"))
|
|
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
|
|
implementation("org.apache.maven.shared:maven-common-artifact-filters") {
|
|
exclude(group: "javax.annotation", module: "javax.annotation-api")
|
|
exclude(group: "javax.enterprise", module: "cdi-api")
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
implementation("org.sonatype.plexus:plexus-build-api") {
|
|
exclude(group: "org.codehaus.plexus:plexus-utils")
|
|
}
|
|
implementation("org.springframework:spring-core")
|
|
implementation("org.springframework:spring-context")
|
|
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-buildpack-platform"))
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
|
|
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
|
intTestImplementation("org.apache.maven.shared:maven-invoker") {
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
intTestImplementation("org.assertj:assertj-core")
|
|
intTestImplementation("org.junit.jupiter:junit-jupiter")
|
|
|
|
mavenOptionalImplementation("org.apache.maven.plugins:maven-shade-plugin") {
|
|
exclude(group: "javax.annotation", module: "javax.annotation-api")
|
|
exclude(group: "javax.enterprise", module: "cdi-api")
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
|
|
mavenRepository(project(path: ":spring-boot-project:spring-boot", configuration: "mavenRepository"))
|
|
mavenRepository(project(path: ":spring-boot-project:spring-boot-test", configuration: "mavenRepository"))
|
|
mavenRepository(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "mavenRepository"))
|
|
mavenRepository(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "mavenRepository"))
|
|
|
|
testImplementation("org.apache.maven:maven-core") {
|
|
exclude(group: "javax.annotation", module: "javax.annotation-api")
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
testImplementation("org.apache.maven.shared:maven-common-artifact-filters") {
|
|
exclude(group: "javax.annotation", module: "javax.annotation-api")
|
|
exclude(group: "javax.enterprise", module: "cdi-api")
|
|
exclude(group: "javax.inject", module: "javax.inject")
|
|
}
|
|
testImplementation("org.assertj:assertj-core")
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
testImplementation("org.mockito:mockito-core")
|
|
testImplementation("org.mockito:mockito-junit-jupiter")
|
|
testImplementation("org.springframework:spring-core")
|
|
|
|
versionProperties(project(path: ":spring-boot-project:spring-boot-dependencies", configuration: "effectiveBom"))
|
|
}
|
|
|
|
ext {
|
|
versionElements = version.split("\\.")
|
|
xsdVersion = versionElements[0] + "." + versionElements[1]
|
|
}
|
|
|
|
syncDocumentationSourceForAsciidoctor {
|
|
from(documentPluginGoals) {
|
|
into "asciidoc/goals"
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
output.dir("${buildDir}/generated/resources/xsd", builtBy: "xsdResources")
|
|
}
|
|
intTest {
|
|
output.dir("${buildDir}/generated-resources", builtBy: "extractVersionProperties")
|
|
}
|
|
dockerTest {
|
|
output.dir("${buildDir}/generated-resources", builtBy: "extractVersionProperties")
|
|
}
|
|
}
|
|
|
|
tasks.withType(org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask) {
|
|
doFirst {
|
|
attributes "spring-boot-xsd-version" : project.ext.xsdVersion
|
|
}
|
|
}
|
|
|
|
asciidoctor {
|
|
sources {
|
|
include "index.adoc"
|
|
}
|
|
}
|
|
|
|
task asciidoctorPdf(type: org.asciidoctor.gradle.jvm.AsciidoctorTask) {
|
|
sources {
|
|
include "index.adoc"
|
|
}
|
|
}
|
|
|
|
syncDocumentationSourceForAsciidoctorPdf {
|
|
from(documentPluginGoals) {
|
|
into "asciidoc/goals"
|
|
}
|
|
}
|
|
|
|
javadoc {
|
|
options {
|
|
author = true
|
|
docTitle = "Spring Boot Maven Plugin ${project.version} API"
|
|
encoding = "UTF-8"
|
|
memberLevel = "protected"
|
|
outputLevel = "quiet"
|
|
splitIndex = true
|
|
use = true
|
|
windowTitle = "Spring Boot Maven Plugin ${project.version} API"
|
|
}
|
|
}
|
|
|
|
task zip(type: Zip) {
|
|
dependsOn asciidoctor, asciidoctorPdf
|
|
duplicatesStrategy "fail"
|
|
from(asciidoctorPdf.outputDir) {
|
|
into "reference/pdf"
|
|
rename "index.pdf", "${project.name}-reference.pdf"
|
|
}
|
|
from(asciidoctor.outputDir) {
|
|
into "reference/htmlsingle"
|
|
}
|
|
from(javadoc) {
|
|
into "api"
|
|
}
|
|
}
|
|
|
|
task xsdResources(type: Sync) {
|
|
from "src/main/xsd/layers-${project.ext.xsdVersion}.xsd"
|
|
into "${buildDir}/generated/resources/xsd/org/springframework/boot/maven"
|
|
rename { fileName -> "layers.xsd" }
|
|
}
|
|
|
|
prepareMavenBinaries {
|
|
versions "3.9.6", "3.6.3"
|
|
}
|
|
|
|
artifacts {
|
|
"documentation" zip
|
|
}
|
|
|
|
tasks.named("documentPluginGoals") {
|
|
goalSections = [
|
|
"build-image": "build-image",
|
|
"build-image-no-fork": "build-image",
|
|
"build-info": "build-info",
|
|
"help": "help",
|
|
"process-aot": "aot",
|
|
"process-test-aot": "aot",
|
|
"repackage": "packaging",
|
|
"run": "run",
|
|
"start": "integration-tests",
|
|
"stop": "integration-tests",
|
|
"test-run": "run"
|
|
]
|
|
}
|
|
|
|
tasks.named("dockerTest").configure {
|
|
dependsOn tasks.named("prepareMavenBinaries")
|
|
}
|