Skip to content

Commit

Permalink
Create sub directories for ThirdPartyAudit dependency matadata
Browse files Browse the repository at this point in the history
Signed-off-by: Finn Carroll <carrofin@amazon.com>
  • Loading branch information
finnegancarroll committed Dec 13, 2024
1 parent 2b402ec commit 6f4639f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,12 @@ private void extractJars(Set<File> jars) {

jars.forEach(jar -> {
FileTree jarFiles = getProject().zipTree(jar);
String jarNamePrefix = jar.getName().split("-")[0];
File jarSubDir = new File(jarExpandDir, jarNamePrefix);

getProject().copy(spec -> {
spec.from(jarFiles);
spec.into(jarExpandDir);
spec.into(jarSubDir);
// exclude classes from multi release jars
spec.exclude("META-INF/versions/**");
});
Expand All @@ -329,7 +332,7 @@ private void extractJars(Set<File> jars) {
Integer.parseInt(targetCompatibility.get().getMajorVersion())
).forEach(majorVersion -> getProject().copy(spec -> {
spec.from(getProject().zipTree(jar));
spec.into(jarExpandDir);
spec.into(jarSubDir);
String metaInfPrefix = "META-INF/versions/" + majorVersion;
spec.include(metaInfPrefix + "/**");
// Drop the version specific prefix
Expand Down

0 comments on commit 6f4639f

Please sign in to comment.