Dynamically populate repositories used in Ant/Maven integration tests
Update build scripts and tests so that repository settings are copied dynamically from the build. See gh-42333
This commit is contained in:
@@ -28,6 +28,7 @@ dependencies {
|
||||
task copyIntegrationTestSources(type: Copy) {
|
||||
from file("src/it")
|
||||
into "${buildDir}/it"
|
||||
filter(springRepoistoryTransformers.ant())
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<ivy pattern="${user.home}/.m2/[organisation]/[module]/[revision]/[module]-[revision].pom" />
|
||||
</filesystem>
|
||||
<ibiblio name="ibiblio" m2compatible="true" />
|
||||
<ibiblio name="spring-milestones" m2compatible="true" root="https://repo.spring.io/milestone" />
|
||||
<ibiblio name="spring-snapshots" m2compatible="true" root="https://repo.spring.io/snapshot" />
|
||||
<!-- {spring.mavenRepositories} -->
|
||||
</chain>
|
||||
</resolvers>
|
||||
</ivysettings>
|
||||
|
||||
@@ -99,12 +99,18 @@ syncDocumentationSourceForAsciidoctor {
|
||||
}
|
||||
}
|
||||
|
||||
task copySettingsXml(type: Copy) {
|
||||
from file("src/intTest/projects/settings.xml")
|
||||
into "${buildDir}/generated-resources/settings"
|
||||
filter(springRepoistoryTransformers.mavenSettings())
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
output.dir("${buildDir}/generated/resources/xsd", builtBy: "xsdResources")
|
||||
}
|
||||
intTest {
|
||||
output.dir("${buildDir}/generated-resources", builtBy: "extractVersionProperties")
|
||||
output.dir("${buildDir}/generated-resources", builtBy: ["extractVersionProperties", "copySettingsXml"])
|
||||
}
|
||||
dockerTest {
|
||||
output.dir("${buildDir}/generated-resources", builtBy: "extractVersionProperties")
|
||||
|
||||
@@ -160,7 +160,7 @@ class MavenBuild {
|
||||
}
|
||||
|
||||
});
|
||||
String settingsXml = Files.readString(Paths.get("src", "intTest", "projects", "settings.xml"))
|
||||
String settingsXml = Files.readString(Paths.get("build", "generated-resources", "settings", "settings.xml"))
|
||||
.replace("@localCentralUrl@", new File("build/test-maven-repository").toURI().toURL().toString())
|
||||
.replace("@localRepositoryPath@", new File("build/local-maven-repository").getAbsolutePath());
|
||||
Files.writeString(destination.resolve("settings.xml"), settingsXml, StandardOpenOption.CREATE_NEW);
|
||||
|
||||
@@ -18,19 +18,7 @@
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/snapshot</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- {spring.mavenRepositories} -->
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
@@ -43,11 +31,7 @@
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
</pluginRepository>
|
||||
<!-- {spring.mavenRepositories} -->
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
Reference in New Issue
Block a user