Stéphane Nicoll b0dd42e9b9 Transform Maven settings with proper plugin repository tag
This commit adapts d44e7c9 to transforms plugin repositories using the
correct root tag. Previously, they were transformed with the regular
<repository> tag, which is invalid.

Closes gh-42687
2024-10-15 10:39:59 +02:00

76 lines
2.1 KiB
Groovy

plugins {
id "java-library"
id "org.springframework.boot.deployed"
}
description = "Spring Boot Antlib"
ext {
antVersion = "1.10.7"
}
configurations {
antUnit
antIvy
}
dependencies {
antUnit "org.apache.ant:ant-antunit:1.3"
antIvy "org.apache.ivy:ivy:2.5.0"
compileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-classic"))
compileOnly("org.apache.ant:ant:${antVersion}")
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
implementation("org.springframework:spring-core")
}
task syncIntegrationTestSources(type: Sync) {
destinationDir file("${buildDir}/it")
from file("src/it")
filter(springRepositoryTransformers.ant())
}
processResources {
eachFile {
filter { it.replace('${spring-boot.version}', project.version) }
}
inputs.property "version", project.version
}
task integrationTest {
dependsOn syncIntegrationTestSources, jar
def resultsDir = file("${buildDir}/test-results/integrationTest")
inputs.dir(file("src/it")).withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("source")
inputs.files(sourceSets.main.runtimeClasspath).withNormalizer(ClasspathNormalizer).withPropertyName("classpath")
outputs.dirs resultsDir
doLast {
ant.with {
taskdef(resource: "org/apache/ant/antunit/antlib.xml",
classpath: configurations.antUnit.asPath)
taskdef(resource: "org/apache/ivy/ant/antlib.xml",
classpath: configurations.antIvy.asPath)
taskdef(resource: "org/springframework/boot/ant/antlib.xml",
classpath: sourceSets.main.runtimeClasspath.asPath,
uri: "antlib:org.springframework.boot.ant")
ant.property(name: "ivy.class.path", value: configurations.antIvy.asPath)
ant.property(name: "antunit.class.path", value: configurations.antUnit.asPath)
antunit {
propertyset {
ant.propertyref(name: "build.compiler")
ant.propertyref(name: "antunit.class.path")
ant.propertyref(name: "ivy.class.path")
}
plainlistener()
file("${buildDir}/test-results/integrationTest").mkdirs()
xmllistener(toDir: resultsDir)
fileset(dir: "${buildDir}/it", includes: "**/build.xml")
}
}
}
}
check {
dependsOn integrationTest
}