Commit ff714f6c authored by Andy Wilkinson's avatar Andy Wilkinson

Update module layout to package custom scope dependencies in lib/

Fixes gh-2187
parent 6391973e
...@@ -17,15 +17,19 @@ ...@@ -17,15 +17,19 @@
package org.springframework.boot.loader.tools; package org.springframework.boot.loader.tools;
import java.io.File; import java.io.File;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* Common {@link Layout}s. * Common {@link Layout}s.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Dave Syer * @author Dave Syer
* @author Andy Wilkinson
*/ */
public class Layouts { public class Layouts {
...@@ -147,6 +151,10 @@ public class Layouts { ...@@ -147,6 +151,10 @@ public class Layouts {
*/ */
public static class Module implements Layout { public static class Module implements Layout {
private static final Set<LibraryScope> LIB_DESTINATION_SCOPES = new HashSet<LibraryScope>(
Arrays.asList(LibraryScope.COMPILE, LibraryScope.RUNTIME,
LibraryScope.CUSTOM));
@Override @Override
public String getLauncherClassName() { public String getLauncherClassName() {
return null; return null;
...@@ -154,7 +162,7 @@ public class Layouts { ...@@ -154,7 +162,7 @@ public class Layouts {
@Override @Override
public String getLibraryDestination(String libraryName, LibraryScope scope) { public String getLibraryDestination(String libraryName, LibraryScope scope) {
if (LibraryScope.COMPILE.equals(scope) || LibraryScope.RUNTIME.equals(scope)) { if (LIB_DESTINATION_SCOPES.contains(scope)) {
return "lib/"; return "lib/";
} }
return null; return null;
......
...@@ -91,6 +91,8 @@ public class LayoutsTests { ...@@ -91,6 +91,8 @@ public class LayoutsTests {
nullValue()); nullValue());
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.RUNTIME), assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.RUNTIME),
equalTo("lib/")); equalTo("lib/"));
assertThat(layout.getLibraryDestination("lib.jar", LibraryScope.CUSTOM),
equalTo("lib/"));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment