I made a support request with JitPack and they've come back with the following code which I have tested to be working as of 2018/04/12:
plugins {
id "com.github.johnrengelman.shadow" version "2.0.2"
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
group = 'com.github.jitpack-io'
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:18.0'
testCompile 'junit:junit:4.12'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
shadowJar {
archiveName = "$baseName-$version.$extension"
}
artifacts {
archives sourcesJar
archives javadocJar
archives shadowJar
}
They've published the code via GitHub.
It can also be combined with the gradle wrapper:
allprojects {
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionType = Wrapper.DistributionType.ALL
}
}