Browse Source

Remove windows line endings when parsing index

pull/20874/head
Phillip Webb 6 years ago
parent
commit
d3c06ee0cf
  1. 3
      spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/main/java/org/springframework/boot/jarmode/layertools/IndexedLayers.java

3
spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/main/java/org/springframework/boot/jarmode/layertools/IndexedLayers.java

@ -44,7 +44,8 @@ class IndexedLayers implements Layers { @@ -44,7 +44,8 @@ class IndexedLayers implements Layers {
private MultiValueMap<String, String> layers = new LinkedMultiValueMap<>();
IndexedLayers(String indexFile) {
String[] lines = Arrays.stream(indexFile.split("\n")).filter(StringUtils::hasText).toArray(String[]::new);
String[] lines = Arrays.stream(indexFile.split("\n")).map((line) -> line.replace("\r", ""))
.filter(StringUtils::hasText).toArray(String[]::new);
String layer = null;
for (String line : lines) {
if (line.startsWith("- ")) {

Loading…
Cancel
Save