I feel like this is a super simple question. I hav...
# gradle
k
I feel like this is a super simple question. I have a Kotlin JVM project making a jar. It's a gradle plugin. There are some local jar's that aren't published to anywhere, so I'm using the shadow plugin to pull them in (https://imperceptiblethoughts.com/shadow/). That's all working, but the build makes the regular jar, and also an '-all' jar from the shadow plugin. I've been trying to configure
maven-publish
and/or
com.vanniktech.maven.publish
to simply replace the regular jar with the '-all' one and publish that. So far, publishing still seems to consider the main jar the primary artifact. The docs don't really get at what I'm trying to go (https://imperceptiblethoughts.com/shadow/publishing/#publishing-with-maven-publish-plugin). So far at best I'm able to get both jars published with the shadow jar mentioned in the module (not the pom), but using it as a dependency pulls in the regular jar and fails because of ClassNotFound type exceptions (for obvious reasons). I'm hoping somebody has a simple answer or example. Seems like it should be easy, but I still haven't found an example that works (with gradle 7+, anyway). Switching focus till late tomorrow but will try to extract a simple example and post. Thanks in advance!
t
Check
ktlint-gradle
plugin - I've spent quite some time to setup publishing it with shadowed jar: https://github.com/JLLeitschuh/ktlint-gradle/blob/master/plugin/build.gradle.kts Basically you need to disable
Jar
task and setup that shadowed jar should be published.
k
Awesome, thanks! Will take a look.