From 3a9d6242ea182160ea04f945191dd67c96eaccc8 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 13 Nov 2014 18:44:10 -0800 Subject: [PATCH] Sync up versions used in Maven integration tests Fixes gh-1797 --- .../src/it/jar-exclude-artifact/pom.xml | 4 ++-- .../src/it/jar-exclude-entry/pom.xml | 4 ++-- .../src/it/jar-exclude-group/pom.xml | 4 ++-- .../it/jar-lib-name-conflict/acme-lib/pom.xml | 2 +- .../jar-lib-name-conflict/test-project/pom.xml | 2 +- .../src/it/jar-pom/pom.xml | 4 ++-- .../src/it/jar-test-scope/pom.xml | 6 +++--- .../src/it/jar-with-unpack/pom.xml | 6 +++--- .../src/it/jar-with-unpack/verify.groovy | 4 ++-- .../src/it/jar/pom.xml | 4 ++-- .../src/it/prop/pom.xml | 4 ++-- .../src/it/run-exclude/pom.xml | 4 ++-- .../src/it/war/pom.xml | 4 ++-- .../org/springframework/boot/maven/Verify.java | 18 ++++++++++++++---- 14 files changed, 40 insertions(+), 30 deletions(-) diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml index 9397de6734..b8f24f81d5 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml @@ -43,12 +43,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml index 2b790adec9..f4b86dcd60 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/pom.xml @@ -48,12 +48,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml index ca2c0db1a7..eee4f1c4a3 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/pom.xml @@ -43,12 +43,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml index 1959bcb58d..5870c43bc3 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/acme-lib/pom.xml @@ -14,7 +14,7 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml index d15c97663b..15f46aa695 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-lib-name-conflict/test-project/pom.xml @@ -51,7 +51,7 @@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml index bf33933101..a8242ceb28 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-pom/pom.xml @@ -29,12 +29,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml index fee741d034..994945fae5 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/pom.xml @@ -43,18 +43,18 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided log4j log4j - 1.2.17 + @log4j.version@ test diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/pom.xml index ae5eeffbb8..3349f7ecd0 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/pom.xml @@ -48,18 +48,18 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided log4j log4j - 1.2.17 + @log4j.version@ diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy index 9abbeb593d..9246765312 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-with-unpack/verify.groovy @@ -22,7 +22,7 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) - verifier.hasUnpackEntry("lib/spring-core-4.0.5.RELEASE.jar") - verifier.hasNonUnpackEntry("lib/spring-context-4.0.5.RELEASE.jar") + verifier.hasUnpackEntry("lib/spring-core-") + verifier.hasNonUnpackEntry("lib/spring-context-") } }.verify(); diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/pom.xml index e9208df9d7..c93303bea9 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/jar/pom.xml @@ -43,12 +43,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml index b170f2e04e..adbc252cb7 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/prop/pom.xml @@ -43,12 +43,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml index f48531ad0c..62394bd0e5 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/run-exclude/pom.xml @@ -38,12 +38,12 @@ log4j log4j - 1.2.17 + @log4j.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/it/war/pom.xml b/spring-boot-tools/spring-boot-maven-plugin/src/it/war/pom.xml index de38c51db7..9ebafb04ea 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/it/war/pom.xml +++ b/spring-boot-tools/spring-boot-maven-plugin/src/it/war/pom.xml @@ -42,12 +42,12 @@ org.springframework spring-context - 4.0.5.RELEASE + @spring.version@ javax.servlet javax.servlet-api - 3.0.1 + @servlet-api.version@ provided diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java b/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java index eb6c888bbc..40bfc64566 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/Verify.java @@ -87,15 +87,25 @@ public class Verify { } } - public boolean hasNonUnpackEntry(String entry) { - return !hasUnpackEntry(entry); + public boolean hasNonUnpackEntry(String entryName) { + return !hasUnpackEntry(entryName); } - public boolean hasUnpackEntry(String entry) { - String comment = this.content.get(entry).getComment(); + public boolean hasUnpackEntry(String entryName) { + String comment = getEntryStartingWith(entryName).getComment(); return comment != null && comment.startsWith("UNPACK:"); } + private ZipEntry getEntryStartingWith(String entryName) { + for (Map.Entry entry : this.content.entrySet()) { + if (entry.getKey().startsWith(entryName)) { + return entry.getValue(); + } + } + throw new IllegalStateException("Unable to find entry starting with " + + entryName); + } + public boolean hasEntry(String entry) { return this.content.containsKey(entry); }