Skip to content

Commit af225a1

Browse files
committed
Include source artifact in Maven publish
1 parent 052b3b8 commit af225a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,17 @@ shadowJar {
4040
manifest.attributes('Implementation-Version': project.version)
4141
}
4242

43+
task sourceJar(type: Jar) {
44+
classifier 'sources'
45+
from sourceSets.main.allJava
46+
}
47+
4348
artifacts {
4449
archives jar
4550
archives shadowJar
51+
archives sourceJar
4652
}
53+
4754
def changelog = file('build/changelog.txt')
4855
def changelog_named = CHANGELOG
4956
if (changelog.exists()) {
@@ -63,6 +70,7 @@ publishing {
6370
mavenJava(MavenPublication) {
6471
from components.java
6572
artifact shadowJar
73+
artifact tasks.sourceJar
6674
if (CHANGELOG.exists())
6775
artifact source: CHANGELOG, classifier: 'changelog'
6876
pom {

0 commit comments

Comments
 (0)