I’m trying to figure out how to publish the “fat j...
# gradle
t
I’m trying to figure out how to publish the “fat jar” created by the shadow plugin, via the
shadowJar
task using the gradle kotlin dsl. So far I’ve had no success after reading through the shadow and maven-publish documentation. Has anyone solved this issue?
b
works for me OOTB ..
Copy code
plugins {
    kotlin("jvm") version "1.4.10"
    id("com.github.johnrengelman.shadow") version "6.1.0"
}
Copy code
tasks.withType<ShadowJar> {
    mergeServiceFiles()
}
ah publish
sry didnt read that
thats my publish block
Copy code
publications {
    register("mavenJava", MavenPublication::class.java) {
        artifactId = rootProject.name
        artifact(sourcesJar)
        from(components["java"])
    }
    register("app", MavenPublication::class.java) {
        project.shadow.component(this)
    }
}
this publishes srcjar, normal jar and shadowJar
t
cool, I’ll give it a go.
Thanks!
Seems to have worked! Thanks.
b
np