Can I get some help on how to properly use the `di...
# gradle
e
Can I get some help on how to properly use the
distribution
plugin? I have a service which has a part which generates some kotlin code from a yaml file (using
snakeyaml
). But that’s only used manually by developers and isn’t required runtime. Yet, their dependencies defined
compileOnly
still appear in
build/install/service/lib
folder. I’ve tried to exlcude them by
Copy code
application { 
   applicationdistribution.exclude("snakeyaml*.jar)
}
but that kept the jar in the lib folder. I wonder what’s the right way to isolate these sub-distributions and include only the required dependencies.
v
First you should not confuse the
distribution
plugin with the
application
plugin. The latter applies the former and creates and configures a distribution for it. If the dependencies are
compileOnly
, they will not land in
.../lib/
unless you intentionally did something to achieve that. I suspect you also have snakeyaml as transitive dependency. You should use the
dependencyInsight
task or a build scan to find out where it comes from.