How to acheive partial global exclude and shading of particular guava packages using shadowJar

We know which packages of guava we are using and want to include and shade those with our jar (ie: base, collect, primitives) . In the interest of keeping the jar small we would like to globally exclude the other com.google.common packages entirely.

I can exclude them from the shading easily enough

relocate("com.", "mypackage.com." ) {
  exclude "com.google.common.eventbus**"
  exclude "com.google.common.hash**"
  exclude "com.google.common.io.**"
  exclude "com.google.common.math.**"
  exclude "com.google.common.net.**"
  exclude "com.google.common.reflect.**"
  exclude "com.google.common.util.**"
}

However, they are then left unshaded in the jar, and I’m having trouble figuring out how to globally exclude them.

It looks to me like the shadowJar dependency exclusion is all or nothing of a maven group:name so I can’t do a partial guava exclusion ie exclude(dependency('com.google.guava:guava????')) .

So far I haven’t been able to get a file exclusion regex pattern to match and exclude them.

Anyone done something like this with shadowJar? We used to used fatjar plugin and an ant jarjar task to do this, but the old way won’t work since a gradle upgrade.

UPDATE: I did notice there is an enhancement filed for shadowJar to implement similar functionality to the maven shade plugin for minimizeJar and also asked there if there is a way to achieve this with current functionality : https://github.com/johnrengelman/shadow/issues/115#issuecomment-141552701