Skip to content

Commit 5c67e6f

Browse files
committed
Update war layout to package custom scope dependencies in WEB-INF/lib/
Fixes gh-2187
1 parent ef64186 commit 5c67e6f

File tree

2 files changed

+7
-0
lines changed
  • spring-boot-tools/spring-boot-loader-tools/src

2 files changed

+7
-0
lines changed

spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*
2727
* @author Phillip Webb
2828
* @author Dave Syer
29+
* @author Andy Wilkinson
2930
*/
3031
public class Layouts {
3132

@@ -103,6 +104,7 @@ public static class War implements Layout {
103104
static {
104105
Map<LibraryScope, String> map = new HashMap<LibraryScope, String>();
105106
map.put(LibraryScope.COMPILE, "WEB-INF/lib/");
107+
map.put(LibraryScope.CUSTOM, "WEB-INF/lib/");
106108
map.put(LibraryScope.RUNTIME, "WEB-INF/lib/");
107109
map.put(LibraryScope.PROVIDED, "WEB-INF/lib-provided/");
108110
SCOPE_DESTINATIONS = Collections.unmodifiableMap(map);

spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* Tests for {@link Layouts}.
3131
*
3232
* @author Phillip Webb
33+
* @author Andy Wilkinson
3334
*/
3435
public class LayoutsTests {
3536

@@ -64,6 +65,8 @@ public void jarLayout() throws Exception {
6465
Layout layout = new Layouts.Jar();
6566
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.COMPILE),
6667
equalTo("lib/"));
68+
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.CUSTOM),
69+
equalTo("lib/"));
6770
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.PROVIDED),
6871
equalTo("lib/"));
6972
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.RUNTIME),
@@ -75,6 +78,8 @@ public void warLayout() throws Exception {
7578
Layout layout = new Layouts.War();
7679
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.COMPILE),
7780
equalTo("WEB-INF/lib/"));
81+
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.CUSTOM),
82+
equalTo("WEB-INF/lib/"));
7883
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.PROVIDED),
7984
equalTo("WEB-INF/lib-provided/"));
8085
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.RUNTIME),

0 commit comments

Comments
 (0)