Skip to content

Commit

Permalink
Get the task named sourceJar, to avoid creating duplicate sources jars
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Dec 18, 2024
1 parent 5715a66 commit 946b538
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public class ModerneProprietaryLicensePlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
// Empty JARs are OK: https://central.sonatype.org/publish/requirements/#supply-javadoc-and-sources
Jar originalSourceJar = project.getTasks().maybeCreate("sourcesJar", Jar.class);
originalSourceJar.setEnabled(false);
project.getTasks().named("sourcesJar", Jar.class).get().setEnabled(false);

Jar sourceJar = project.getTasks().create("emptySourceJar", Jar.class, task -> {
task.from("README.md");
Expand Down

0 comments on commit 946b538

Please sign in to comment.