in src/main/java/org/apache/maven/plugins/shade/DefaultShader.java [259:321]
private void shadeDir(
ShadeRequest shadeRequest,
Set<String> resources,
List<ResourceTransformer> transformers,
DefaultPackageMapper packageMapper,
JarOutputStream jos,
Map<String, HashSet<File>> duplicates,
File jar,
File current,
String prefix,
List<Filter> jarFilters)
throws IOException {
final File[] children = current.listFiles();
if (children == null) {
return;
}
for (final File file : children) {
final String name = prefix + file.getName();
if (file.isDirectory()) {
try {
shadeDir(
shadeRequest,
resources,
transformers,
packageMapper,
jos,
duplicates,
jar,
file,
prefix + file.getName() + '/',
jarFilters);
continue;
} catch (Exception e) {
throw new IOException(String.format("Problem shading JAR %s entry %s: %s", current, name, e), e);
}
}
if (isFiltered(jarFilters, name) || isExcludedEntry(name)) {
continue;
}
try {
shadeJarEntry(
shadeRequest,
resources,
transformers,
packageMapper,
jos,
duplicates,
jar,
new Callable<InputStream>() {
@Override
public InputStream call() throws Exception {
return Files.newInputStream(file.toPath());
}
},
name,
file.lastModified(),
-1 /*ignore*/);
} catch (Exception e) {
throw new IOException(String.format("Problem shading JAR %s entry %s: %s", current, name, e), e);
}
}
}