From db18f72047e0ddc9897984245517043425c1222c Mon Sep 17 00:00:00 2001 From: stephengold Date: Sun, 19 May 2024 10:43:53 -0700 Subject: [PATCH] build.gradle: don't use withSourcesJar()---it adds resources to the JAR --- build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 8c241cc..1995c09 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,6 @@ java { sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_8 withJavadocJar() - withSourcesJar() } dependencies { @@ -71,6 +70,13 @@ jar { } } +tasks.register('sourcesJar', Jar) { + archiveBaseName = project.ext.baseName + archiveClassifier = 'sources' + description 'Creates a JAR of Java sourcecode.' + from sourceSets.main.allJava // default is ".allSource", which include resources +} + assemble.dependsOn('module', 'moduleAsc', 'pom', 'pomAsc') tasks.register('module', Copy) { dependsOn 'generateMetadataFileForMavenPublication' @@ -104,6 +110,7 @@ tasks.register('pomAsc', Copy) { publishing { publications { maven(MavenPublication) { + artifact sourcesJar artifactId artifact from components.java groupId project.ext.group