From 52c2c534dba865234ea090df107264cf41a6e5e1 Mon Sep 17 00:00:00 2001 From: "daonan.zhan" Date: Mon, 22 Apr 2019 10:07:31 +0800 Subject: [PATCH] Polish Maven Plugin's tests See gh-16618 --- .../src/it/jar-exclude-artifact/pom.xml | 63 ------------------- .../main/java/org/test/SampleApplication.java | 24 ------- .../src/it/jar-exclude-artifact/verify.groovy | 11 ---- .../src/it/jar-exclude-entry/verify.groovy | 2 +- .../src/it/jar-exclude-group/verify.groovy | 2 +- .../src/it/jar-test-scope/verify.groovy | 2 +- 6 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml delete mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/src/main/java/org/test/SampleApplication.java delete mode 100644 spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml deleted file mode 100644 index 6b2816c3f3..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - 4.0.0 - org.springframework.boot.maven.it - jar-exclude-artifact - 0.0.1.BUILD-SNAPSHOT - - UTF-8 - @java.version@ - @java.version@ - - - - - @project.groupId@ - @project.artifactId@ - @project.version@ - - - - repackage - - - servlet-api - - - - - - org.apache.maven.plugins - maven-jar-plugin - @maven-jar-plugin.version@ - - - - Foo - - - - - - - - - org.springframework - spring-context - @spring.version@ - - - javax.servlet - javax.servlet-api - @servlet-api.version@ - provided - - - javax.servlet - servlet-api - 2.5 - provided - - - diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/src/main/java/org/test/SampleApplication.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/src/main/java/org/test/SampleApplication.java deleted file mode 100644 index 98dca2ddd1..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/src/main/java/org/test/SampleApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012-2017 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.test; - -public class SampleApplication { - - public static void main(String[] args) { - } - -} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy deleted file mode 100644 index 5fb7b201ca..0000000000 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-artifact/verify.groovy +++ /dev/null @@ -1,11 +0,0 @@ -import java.io.*; -import org.springframework.boot.maven.*; - -File f = new File(basedir, "target/jar-exclude-artifact-0.0.1.BUILD-SNAPSHOT.jar") -new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { - @Override - protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { - super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar") - } -}.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy index b628a4b87c..f058e453e1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-entry/verify.groovy @@ -22,6 +22,6 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("lib/servlet-api-2.5.jar") + verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/servlet-api-2.5.jar") } }.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy index 0d5cbe9623..ca51ff668e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-exclude-group/verify.groovy @@ -22,6 +22,6 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar") + verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/log4j-api-2.4.1.jar") } }.verify() diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy index 26e679fd02..13ccd83c4e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/it/jar-test-scope/verify.groovy @@ -22,6 +22,6 @@ new Verify.JarArchiveVerification(f, Verify.SAMPLE_APP) { @Override protected void verifyZipEntries(Verify.ArchiveVerifier verifier) throws Exception { super.verifyZipEntries(verifier) - verifier.assertHasNoEntryNameStartingWith("lib/log4j-api-2.4.1.jar") + verifier.assertHasNoEntryNameStartingWith("BOOT-INF/lib/log4j-api-2.4.1.jar") } }.verify()