Closed weisJ closed 4 years ago
Actually, gradle puts all of the license files inside the jar file without any problems, as duplicate zip entries are allowed (not in java though). But you are right, it would be nice to know from which library they come from. I really don't like the idea of making threadtear an application as in my opinion a standalone .jar file is much more compact than a folder with bin, lib, etc.
Actually, gradle puts all of the license files inside the jar file without any problems, as duplicate zip entries are allowed (not in java though).
I don’t see this reflected in the resulting fat jar. There are still licenses that are missing.
(using WinRAR)
What tool are you using?
I was using the archive view in IntelliJ, which apparently doesn’t show duplicate files. I still think it would be nice to remove the ambiguity between the licenses. One shouldn’t be forced to use a certain program to view them.
Of course, that's what i also think. Will probably use shadow to handle that.
With #26 I have implemented merging of unique licenses with the same name into one file. I think for now this is the best one can do with the shadow plugin, as neither the relocators nor the transformers get information about the original dependency a file comes from.
Should this be closed?
Can be closed. If the shadow plugin ever gets updated to include dependency information for files the current approach can be improved.
Currently the
fatJar
task simply copies the content of each dependency into the jar. This results in files that have the same name to be overwritten. Because most licenses are located at (and called)META-INF/LICENSE
only one of those will survive (which isn't event deterministic.I see two possible solutions here.
Switch to a plugin which handles the creation of the fat jar e.g. shadow and configure it to copy the contents of the
META-INF
folder of each jar toMETA-INF/<dependency-name>
.Switch from
java-library
tothe
applicationplugin. The
application` plugin creates a distribution zip which contains all jar files and a startup script.The resulting zip has the following structure.