truth icon indicating copy to clipboard operation
truth copied to clipboard

Auto-value dependency drags dep into truth's downstream

Open cgruber opened this issue 5 years ago • 3 comments

Auto-value annotations dependency is specified as a default (compile) dependency, which in maven-land means needed at compile time and runtime. This means that it leaks the version truth uses to any downstream project that fails to specify it, possibly conflicting with newer usages. Since Truth only needs auto-value to build itself, we should specify the dep as provided so it's not included in the transitive closure of Truth.

cgruber avatar Jun 24 '19 20:06 cgruber

Our experience has been that provided makes things better for some people but worse for others: https://github.com/google/guava/issues/2824

I could see adopting the jarjar approach you mention in https://github.com/google/truth/pull/591, but ideally we'd leave the deps in place if the annotations continue to be present.

cpovirk avatar Jun 24 '19 21:06 cpovirk

Ah, I see what you mean. I can rework this to remove the usages, given that they're totally vestigial at runtime. I can see the noise problem downstream, because of the warning behavior.

cgruber avatar Jun 24 '19 21:06 cgruber

Also running into this issue. Of course we can work around it, but would love to see the proposed fix ship.

bryanstern avatar Oct 10 '19 00:10 bryanstern