Skip to content
This repository was archived by the owner on Aug 10, 2024. It is now read-only.

Commit 190c28f

Browse files
committed
sonatype apparently now requires source, hopefully this provides
1 parent 00fca3c commit 190c28f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

buildSrc/src/main/kotlin/buildsrc/conventions/maven-publish.gradle.kts

+11
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ val javadocJarStub by tasks.creating(Jar::class) {
3333
archiveClassifier.set("javadoc")
3434
}
3535

36+
val sourcesJar by tasks.registering(Jar::class) {
37+
archiveClassifier.set("sources")
38+
// Accessing sourceSets within the Java plugin's scope
39+
project.plugins.withType<JavaPlugin>().configureEach {
40+
from(project.the<JavaPluginExtension>().sourceSets["main"].allSource)
41+
}
42+
}
3643

3744
publishing {
3845
publications.withType<MavenPublication>().configureEach {
@@ -42,6 +49,10 @@ publishing {
4249

4350
artifact(javadocJarStub)
4451

52+
// Added 2023-12-02 to fix "Missing: no sources jar found in folder
53+
// '/io/kweb/kweb-core/1.4.9'" encountered when publishing to Maven Central
54+
artifact(sourcesJar)
55+
4556
// apply default configs for all Maven publications
4657
pom {
4758
name.set("Kweb")

0 commit comments

Comments
 (0)