diff --git a/src/main/java/walkingkooka/j2cl/maven/J2clSourcesKind.java b/src/main/java/walkingkooka/j2cl/maven/J2clSourcesKind.java index 2d78ec4..6517002 100644 --- a/src/main/java/walkingkooka/j2cl/maven/J2clSourcesKind.java +++ b/src/main/java/walkingkooka/j2cl/maven/J2clSourcesKind.java @@ -22,6 +22,7 @@ import org.apache.maven.project.MavenProject; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.Collection; @@ -93,18 +94,18 @@ private static List concat(final Function mapper, .filter(Objects::nonNull) .flatMap(Collection::stream) .map(mapper) - .map(p -> p.startsWith(SEPARATOR) ? - p : - base + SEPARATOR + p - ).map(Paths::get) + .map(p -> { + final Path path = Paths.get(p); + return path.isAbsolute() ? + path : + Paths.get(base.toString(), p); + }) .filter(Files::exists) .map(J2clPath::with) .distinct() .collect(Collectors.toList()); } - private final static String SEPARATOR = "/"; - @SafeVarargs private static List concat(final List... sources) { return Arrays.stream(sources)