java - How to alter dependencies for a generated artifact? -


gradle 2.3; shadow plugin 1.2.1.

in build.gradle, use shadow plugin in order repackage dependency, such:

shadowjar {     relocate("com.google.common", "r.com.google.common"); } 

i add shadow jar list of artifacts publish:

artifacts {     archives jar;     archives sourcesjar;     archives javadocjar;     archives shadowjar; } 

however list of dependencies of shadow jar still contains dependencies of "normal" jar, though has every dependency builtin.

is intended behavior? how can make shadow jar exclude or dependency?

here @ work had same problem , put in build.gradle of 1 of our projects:

def installer = install.repositories.maveninstaller def deployer = uploadarchives.repositories.mavendeployer  [installer, deployer]*.pom*.whenconfigured { pom ->     pom.dependencies.retainall {         it.groupid == 'our.group.id' && it.artifactid == 'some-api'     } } 

this removes dependencies pom.xml except dependency on 1 of our api projects.

(and pretty verbatim copy of example official gradle documentation.)


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -