|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
|
JDK-8165513 :
|
With JDK-8114827 "JDK 9 multi-release enabled jar tool" jar tool ignores second '-C <dir> .' folder, i.e.:
jar -cf MyJar.jar -C <folder1> . -C <folder2> .
In this case classes from <folder2> subfolders are absent in the MyJar.jar file.
Looks like the problem in the following piece of code(src/jdk.jartool/share/classes/sun/tools/jar/Main.java):
void expand(File dir,
String[] files,
boolean isUpdate,
Map<String,Path> moduleInfoPaths,
int version)
throws IOException
{
...
Entry entry = new Entry(version, f);
String entryName = entry.entryname;
...
} else if (f.isDirectory()) {
if (!entries.containsKey(entryName)) {
entries.put(entryName, entry);
if (isUpdate) {
entryMap.put(entryName, entry);
}
expand(f, f.list(), isUpdate, moduleInfoPaths, version);
}
} else {
...
entryname for <folder1> and <folder2> will be the same, i.e. empty. And in this case if (!entries.containsKey(entryName)) { will be false and second(and others) folders are not proceeded.
|