|
final CopySpec license = project.copySpec(copy -> copy.from(project.getRootDir()).include("LICENSE")); |
LICENSE file at the root of the jar results in collisions when fat jar is generated (e.g. in case multiple dependencies have LICENSE at the top level).
META-INF/LICENSE is more-or-less standard location for the license.
An alternative option is to make license inclusion optional.
Note: different JAR files might need different licenses (e.g. regular and fat jar), so it is not right to put the same license file everywhere.