Add source jar with Gradle
gradle/with-source
generate a sources.jar while project build
1// For Gradle 6.0+
2// Require "java" or "java-library" plugin
3java {
4    withSourcesJar()
5}
6
7// For Any Gradle Version
8// no plugin required
9task sourcesJar(type: Jar, dependsOn: jar) {
10    classifier = 'sources'
11    from sourceSets.main.allSource
12}
Unauthorized reproduction of original content on this website is prohibited.