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

Provide an artifact that shades or omits Guava and other dependencies #20

Closed
cpovirk opened this issue Jan 13, 2016 · 10 comments
Closed

Comments

@cpovirk
Copy link
Member

cpovirk commented Jan 13, 2016

As noted in google/dagger#228 (comment) and the comment it replies to, the google-java-format jar contains classes from Guava and other dependencies. Those classes end up in Dagger, where they conflict with the version of Guava used by Dagger -- and, because of Maven's lack of support for -processorpath, with the version of Guava used by Dagger users like Caliper.

I don't know enough about Maven to say what the right thing here is. The easiest thing, I'd guess, is shading, but for all I know, this may be difficult with the Eclipse classes for some reason.

@alicederyn
Copy link
Contributor

Why does the JAR include its dependencies at all? That's not the way JARs usually work. If it is necessary, can you create a new JAR, google-java-format-all for instance, that can be used stand-alone?

@alicederyn
Copy link
Contributor

Incidentally, FreeBuilder uses google-java-format without issue, because it does its own shading; there's no reason Dagger can't do the same, beyond the effort involved. But this issue should still be fixed, because otherwise processorpath ordering can silently downgrade Guava for your users.

@ronshapiro
Copy link
Contributor

It doesn't include the dependencies, but the pom.xml references Guava 18.0.

@ronshapiro
Copy link
Contributor

@cpovirk [maven doc] It's not the easiest to read (so much xml to parse...) but it seems like you can force a version to be used via the parent pom.xml's <dependencyManagement> section.

@tbroyer
Copy link
Contributor

tbroyer commented Jan 13, 2016

@ronshapiro Yes it does! (note: the maven-shade-plugin is declared in the parent POM)

wget -O google-java-format.jar https://search.maven.org/remotecontent?filepath=com/google/googlejavaformat/google-java-format/0.1-alpha/google-java-format-0.1-alpha.jar
jar -tf google-java-format.jar

@ronshapiro
Copy link
Contributor

Ah, my mistake, I was looking at -sources.jar. Thanks @tbroyer for the correction

@cushon
Copy link
Collaborator

cushon commented Jan 13, 2016

The fat jar was supposed to be for command line use, I agree it's a bad idea for the artifact we publish to maven.

(And I updated google-java-format to use guava 19.)

@tbroyer
Copy link
Contributor

tbroyer commented Jan 13, 2016

Use maven-assembly-plugin then to publish an all-deps jar as an attached artifact?

cushon added a commit to cushon/google-java-format that referenced this issue Jan 14, 2016
@cushon
Copy link
Collaborator

cushon commented Jan 14, 2016

Any concerns with #21?

@tbroyer
Copy link
Contributor

tbroyer commented Apr 1, 2016

Can this be released?

ronshapiro pushed a commit to google/dagger that referenced this issue Apr 22, 2016
…t bundling but not relocating their copy of guava, which affected 2.3. The issue is no longer there, and the tests should fail if it regresses.

relates to #288 and was partly resolved by google/google-java-format#20 and depending on the newer released (unshaded) formatter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120469748
ronshapiro pushed a commit to google/dagger that referenced this issue Apr 22, 2016
…t bundling but not relocating their copy of guava, which affected 2.3. The issue is no longer there, and the tests should fail if it regresses.

relates to #288 and was partly resolved by google/google-java-format#20 and depending on the newer released (unshaded) formatter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120469748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants