Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimizeJar #115

Closed
Petikoch opened this issue Dec 7, 2014 · 7 comments
Closed

minimizeJar #115

Petikoch opened this issue Dec 7, 2014 · 7 comments

Comments

@Petikoch
Copy link

Petikoch commented Dec 7, 2014

Hi @johnrengelman ,

I was wondering if shadow has also a minimizeJar like feature like the maven-shade-plugin: http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html

Best regards,
Peti

@johnrengelman
Copy link
Collaborator

This feature is not currently implemented.

@Petikoch
Copy link
Author

Thanks for your feedback.

@johnrengelman
Copy link
Collaborator

Gonna reopen this to track possible future enhancements.

@johnrengelman johnrengelman reopened this Sep 17, 2015
@Petikoch
Copy link
Author

👍

@sporkthrower
Copy link

I have a somewhat related question, which may be feasible with current exclude capabilities, and I just don't know how to accomplish it.

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 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. Do you have any advice for how we might be able to accomplish this with the 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.

@janschaefer
Copy link
Contributor

Seems to be a duplicate of #198

@johnrengelman
Copy link
Collaborator

Yup. Closing this in favor of tracking enhancements on #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants