Skip to content

Commit

Permalink
sets duplicatesstrategy to exclude when copying libs
Browse files Browse the repository at this point in the history
  • Loading branch information
fvarrui committed Apr 21, 2024
1 parent 708eb58 commit 8064350
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.File;

import org.gradle.api.Project;
import org.gradle.api.file.DuplicatesStrategy;
import org.gradle.api.tasks.Copy;

import io.github.fvarrui.javapackager.packagers.ArtifactGenerator;
Expand Down Expand Up @@ -35,6 +36,7 @@ protected File doApply(Packager packager) {
if (copyLibsTask == null) {
copyLibsTask = project.getTasks().create("copyLibs", Copy.class);
}
copyLibsTask.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);
copyLibsTask.from(project.getConfigurations().getByName("runtimeClasspath"));
copyLibsTask.into(project.file(libsFolder));
copyLibsTask.getActions().forEach(action -> action.execute(copyLibsTask));
Expand Down

0 comments on commit 8064350

Please sign in to comment.