The shadow plugin does not seem to have the ability to create jars with bold sources / javadocs.
Below I provide a few short tasks ( javadocJar and sourcesJar ) that will build live javadoc and source banks. They are bound to always execute after shadowJar . But it has nothing to do with the shadow banner plugin.
subprojects { apply plugin: 'java' } // Must be BELOW subprojects{} task alljavadoc(type: Javadoc) { source subprojects.collect { it.sourceSets.main.allJava } classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath }) destinationDir = file("${buildDir}/docs/javadoc") } task javadocJar(type: Jar, dependsOn: alljavadoc) { classifier = 'javadoc' from alljavadoc.destinationDir } task sourcesJar(type: Jar) { classifier = 'sources' from subprojects.collect { it.sourceSets.main.allSource } } shadowJar.finalizedBy javadocJar shadowJar.finalizedBy sourcesJar
Please note: the subprojects section subprojects required even if you already use the java plugin inside your subprojects.
Also note that it does not include third-party javadocs that your subprojects may affect. But as a rule, you would not want to do this anyway, perhaps.
Artem Novikov
source share