From 5c67e6f1411a56ca1d54bf44583e5e454260fb97 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 17 Dec 2014 20:21:29 +0000 Subject: [PATCH] Update war layout to package custom scope dependencies in WEB-INF/lib/ Fixes gh-2187 --- .../java/org/springframework/boot/loader/tools/Layouts.java | 2 ++ .../org/springframework/boot/loader/tools/LayoutsTests.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java index 64291d8443..fcc47ed983 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java @@ -26,6 +26,7 @@ import java.util.Map; * * @author Phillip Webb * @author Dave Syer + * @author Andy Wilkinson */ public class Layouts { @@ -103,6 +104,7 @@ public class Layouts { static { Map map = new HashMap(); map.put(LibraryScope.COMPILE, "WEB-INF/lib/"); + map.put(LibraryScope.CUSTOM, "WEB-INF/lib/"); map.put(LibraryScope.RUNTIME, "WEB-INF/lib/"); map.put(LibraryScope.PROVIDED, "WEB-INF/lib-provided/"); SCOPE_DESTINATIONS = Collections.unmodifiableMap(map); diff --git a/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java b/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java index dc7f0d4fca..22bfc277b9 100644 --- a/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java +++ b/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java @@ -30,6 +30,7 @@ import static org.junit.Assert.assertThat; * Tests for {@link Layouts}. * * @author Phillip Webb + * @author Andy Wilkinson */ public class LayoutsTests { @@ -64,6 +65,8 @@ public class LayoutsTests { Layout layout = new Layouts.Jar(); assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.COMPILE), equalTo("lib/")); + assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.CUSTOM), + equalTo("lib/")); assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.PROVIDED), equalTo("lib/")); assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.RUNTIME), @@ -75,6 +78,8 @@ public class LayoutsTests { Layout layout = new Layouts.War(); assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.COMPILE), equalTo("WEB-INF/lib/")); + assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.CUSTOM), + equalTo("WEB-INF/lib/")); assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.PROVIDED), equalTo("WEB-INF/lib-provided/")); assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.RUNTIME),