auto-value 1.10 includes (very old) copies of org.jetbrains.annotations.(NotNull|Nullable)
pburka opened this issue · comments
The auto-value-1.10.jar
on Maven includes two non-shaded classes copied from jetbrains-annotations 13.0:
546 Defl:N 325 41% 2013-12-17 16:10 ed26fa9e org/jetbrains/annotations/NotNull.class
548 Defl:N 326 41% 2013-12-17 16:10 d6e46bc1 org/jetbrains/annotations/Nullable.class
The current version of jetbrains-annotations is 23.0, and the annotations are different in the new version. Specifically, the annotation target has been extended to include TYPE_USE
in newer versions. By including these old annotations, auto-value can shadow the new versions (depending on classpath order), resulting in compilation errors, especially if auto-value is being used somewhat naively (i.e. on the classpath instead of the processorpath).
Ideally, the auto-value jar shouldn't include unshaded jetbrains annotations. If it must include them, it should pull them from the latest version rather than the oldest.
The problem arises like this:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ auto-value ---
[INFO] com.google.auto.value:auto-value:jar:HEAD-SNAPSHOT
[INFO] \- org.jetbrains.kotlinx:kotlinx-metadata-jvm:jar:0.5.0:compile
[INFO] \- org.jetbrains.kotlin:kotlin-stdlib:jar:1.7.0:compile
[INFO] \- org.jetbrains:annotations:jar:13.0:compile
Sadly kotlin-stdlib
depends on this ancient version of org.jetbrains:annotations
. From 2013!
Anyway, this was an oversight. There's no reason we can't shade org.jetbrains
along with everything else.
This problem is fixed in the just-released 1.10.1.