Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Build non-shaded jar as well as shaded #162

Merged
merged 3 commits into from
Sep 21, 2016
Merged

Build non-shaded jar as well as shaded #162

merged 3 commits into from
Sep 21, 2016

Conversation

dvgica
Copy link
Contributor

@dvgica dvgica commented Sep 20, 2016

Hi there, thanks for this very useful lib!

We are having a bit of trouble using it, unfortunately, because it's shaded-only. While shading a JAR can be useful to solve some problems, it can also cause different issues to crop up.

For example, when using the shaded JAR with sbt-assembly, you get conflicting files:

[error] (*:assembly) deduplicate: different file contents found in the following:
[error] /home/dvangeest/.ivy2/cache/com.fasterxml.jackson.core/jackson-annotations/bundles/jackson-annotations-2.6.0.jar:META-INF/maven/com.fasterxml.jackson.core/jackson-annotations/pom.properties
[error] /home/dvangeest/.ivy2/cache/com.orbitz.consul/consul-client/jars/consul-client-0.12.3.jar:META-INF/maven/com.fasterxml.jackson.core/jackson-annotations/pom.properties
[error] Total time: 19 s, completed 20-Sep-2016 10:54:39 AM

A simple solution to this is to allow the user to pick whether they want to use the shaded JAR or a non-shaded JAR. This PR tweaks the maven-shade-plugin config to build both a shaded and non-shaded JAR according to http://maven.apache.org/plugins/maven-shade-plugin/examples/attached-artifact.html.

This does mean that the default JAR is now un-shaded again, and to get the shaded JAR you need to put a shaded classifier on your dependency. While this is maybe a little annoying in the short-term, long-term it's closer to what people expect. That is, most people expect JARs to be un-shaded. Having a shaded JAR is an exception and should be treated as such.

Please let me know if I can do anything else to get this merged. Thanks!

David van Geest added 3 commits September 20, 2016 10:24

Verified

This commit was signed with the committer’s verified signature.
jrjohnson Jon Johnson

Verified

This commit was signed with the committer’s verified signature.
jrjohnson Jon Johnson

Verified

This commit was signed with the committer’s verified signature.
jrjohnson Jon Johnson
@rickfast
Copy link
Owner

It's been hard to keep everyone happy with regards to transitive dependencies, so this seems like a good idea. Thanks

@rickfast rickfast merged commit f1b11df into rickfast:master Sep 21, 2016
@rickfast
Copy link
Owner

0.13.0 is now available in jcenter and central

@dvgica
Copy link
Contributor Author

dvgica commented Sep 21, 2016

Awesome, thanks a ton for the quick response.

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

Successfully merging this pull request may close these issues.

None yet

2 participants