From b1777b9deebbe376cc17372647a7896fb3644901 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 1 Jun 2020 16:28:33 +0100 Subject: [PATCH] Use stable file repository for testing snapshot layers Closes gh-21629 --- .../tasks/bundling/BootJarIntegrationTests.java | 12 ++++++------ .../BootJarIntegrationTests-customLayers.gradle | 4 ++-- .../BootJarIntegrationTests-implicitLayers.gradle | 4 ++-- ...ntegrationTests-multiModuleCustomLayers.gradle | 4 ++-- .../library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.jar | Bin 0 -> 261 bytes .../library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.pom | 8 ++++++++ 6 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/repository/com/example/library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.jar create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/repository/com/example/library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.pom diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java index 982dd8bb39..a3f7459bdd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests.java @@ -98,7 +98,7 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { assertThat(jarFile.getEntry("BOOT-INF/lib/commons-lang3-3.9.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/lib/spring-core-5.2.5.RELEASE.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/lib/spring-jcl-5.2.5.RELEASE.jar")).isNotNull(); - assertThat(jarFile.getEntry("BOOT-INF/lib/commons-io-2.7-SNAPSHOT.jar")).isNotNull(); + assertThat(jarFile.getEntry("BOOT-INF/lib/library-1.0-SNAPSHOT.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/classes/example/Main.class")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/classes/static/file.txt")).isNotNull(); indexedLayers = readLayerIndex(jarFile); @@ -111,7 +111,7 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { expectedDependencies.add("BOOT-INF/lib/spring-core-5.2.5.RELEASE.jar"); expectedDependencies.add("BOOT-INF/lib/spring-jcl-5.2.5.RELEASE.jar"); Set expectedSnapshotDependencies = new TreeSet<>(); - expectedSnapshotDependencies.add("BOOT-INF/lib/commons-io-2.7-SNAPSHOT.jar"); + expectedSnapshotDependencies.add("BOOT-INF/lib/library-1.0-SNAPSHOT.jar"); (layerToolsJar.contains("SNAPSHOT") ? expectedSnapshotDependencies : expectedDependencies).add(layerToolsJar); assertThat(indexedLayers.get("dependencies")).containsExactlyElementsOf(expectedDependencies); assertThat(indexedLayers.get("spring-boot-loader")).containsExactly("org/"); @@ -140,7 +140,7 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { assertThat(jarFile.getEntry("BOOT-INF/lib/commons-lang3-3.9.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/lib/spring-core-5.2.5.RELEASE.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/lib/spring-jcl-5.2.5.RELEASE.jar")).isNotNull(); - assertThat(jarFile.getEntry("BOOT-INF/lib/commons-io-2.7-SNAPSHOT.jar")).isNotNull(); + assertThat(jarFile.getEntry("BOOT-INF/lib/library-1.0-SNAPSHOT.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/classes/example/Main.class")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/classes/static/file.txt")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/layers.idx")).isNotNull(); @@ -153,7 +153,7 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { expectedDependencies.add("BOOT-INF/lib/spring-core-5.2.5.RELEASE.jar"); expectedDependencies.add("BOOT-INF/lib/spring-jcl-5.2.5.RELEASE.jar"); List expectedSnapshotDependencies = new ArrayList<>(); - expectedSnapshotDependencies.add("BOOT-INF/lib/commons-io-2.7-SNAPSHOT.jar"); + expectedSnapshotDependencies.add("BOOT-INF/lib/library-1.0-SNAPSHOT.jar"); (layerToolsJar.contains("SNAPSHOT") ? expectedSnapshotDependencies : expectedDependencies).add(layerToolsJar); assertThat(indexedLayers.get("dependencies")).containsExactlyElementsOf(expectedDependencies); assertThat(indexedLayers.get("commons-dependencies")).containsExactly("BOOT-INF/lib/commons-lang3-3.9.jar"); @@ -193,7 +193,7 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { assertThat(jarFile.getEntry("BOOT-INF/lib/commons-lang3-3.9.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/lib/spring-core-5.2.5.RELEASE.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/lib/spring-jcl-5.2.5.RELEASE.jar")).isNotNull(); - assertThat(jarFile.getEntry("BOOT-INF/lib/commons-io-2.7-SNAPSHOT.jar")).isNotNull(); + assertThat(jarFile.getEntry("BOOT-INF/lib/library-1.0-SNAPSHOT.jar")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/classes/example/Main.class")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/classes/static/file.txt")).isNotNull(); assertThat(jarFile.getEntry("BOOT-INF/layers.idx")).isNotNull(); @@ -209,7 +209,7 @@ class BootJarIntegrationTests extends AbstractBootArchiveIntegrationTests { expectedDependencies.add("BOOT-INF/lib/spring-core-5.2.5.RELEASE.jar"); expectedDependencies.add("BOOT-INF/lib/spring-jcl-5.2.5.RELEASE.jar"); List expectedSnapshotDependencies = new ArrayList<>(); - expectedSnapshotDependencies.add("BOOT-INF/lib/commons-io-2.7-SNAPSHOT.jar"); + expectedSnapshotDependencies.add("BOOT-INF/lib/library-1.0-SNAPSHOT.jar"); (layerToolsJar.contains("SNAPSHOT") ? expectedSnapshotDependencies : expectedDependencies).add(layerToolsJar); assertThat(indexedLayers.get("subproject-dependencies")) .containsExactlyElementsOf(expectedSubprojectDependencies); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle index 22f6f433b8..7619fc25e3 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-customLayers.gradle @@ -27,11 +27,11 @@ bootJar { repositories { mavenCentral() - maven { url "https://repository.apache.org/content/repositories/snapshots" } + maven { url "file:repository" } } dependencies { - implementation("commons-io:commons-io:2.7-SNAPSHOT") + implementation("com.example:library:1.0-SNAPSHOT") implementation("org.apache.commons:commons-lang3:3.9") implementation("org.springframework:spring-core:5.2.5.RELEASE") } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle index 22dc55ae65..3c2218ae4c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-implicitLayers.gradle @@ -10,11 +10,11 @@ bootJar { repositories { mavenCentral() - maven { url "https://repository.apache.org/content/repositories/snapshots" } + maven { url "file:repository" } } dependencies { - implementation("commons-io:commons-io:2.7-SNAPSHOT") + implementation("com.example:library:1.0-SNAPSHOT") implementation("org.apache.commons:commons-lang3:3.9") implementation("org.springframework:spring-core:5.2.5.RELEASE") } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle index cc98baa708..f8bcb11afa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle @@ -36,13 +36,13 @@ bootJar { repositories { mavenCentral() - maven { url "https://repository.apache.org/content/repositories/snapshots" } + maven { url "file:repository" } } dependencies { implementation(project(':alpha')) implementation(project(':bravo')) - implementation("commons-io:commons-io:2.7-SNAPSHOT") + implementation("com.example:library:1.0-SNAPSHOT") implementation("org.apache.commons:commons-lang3:3.9") implementation("org.springframework:spring-core:5.2.5.RELEASE") } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/repository/com/example/library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.jar b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/repository/com/example/library/1.0-SNAPSHOT/library-1.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..772cfe2d526894df5b903c2251536878732db208 GIT binary patch literal 261 zcmWIWW@h1HVBp|j2q-@ozyJhHAOZ+Df!NnI#8KDN&rP41Apk|;rh2A#(m(~0KrDi+ z(AUw=)6F$FM9 + + 4.0.0 + com.example + library + 1.0-SNAPSHOT +