Getting a NoSuchMethod error for org.pantsbuild.jarjar.* classes
BardurArantsson opened this issue · comments
So, I'm trying to use this plugin as a replacement for coursier's shading[0], but I'm getting NoSuchMethodError whan trying to run a 'package':
[error] (shadedCirceGeneric / Compile / jarjarPackageBinMappings) java.lang.NoSuchMethodError: org.pantsbuild.jarjar.JJProcessor.<init>(Lscala/collection/Seq;ZZLjava/lang/String;)V
[error] (shadedCirceGenericExtras / Compile / jarjarPackageBinMappings) java.lang.NoSuchMethodError: org.pantsbuild.jarjar.JJProcessor.<init>(Lscala/collection/Seq;ZZLjava/lang/String;)V
[error] (shadedCirceYaml / Compile / jarjarPackageBinMappings) java.lang.NoSuchMethodError: org.pantsbuild.jarjar.JJProcessor.<init>(Lscala/collection/Seq;ZZLjava/lang/String;)V
[error] (shadedCirceCore / Compile / jarjarPackageBinMappings) java.lang.NoSuchMethodError: org.pantsbuild.jarjar.JJProcessor.<init>(Lscala/collection/Seq;ZZLjava/lang/String;)V
[error] (shadedCirceGenericParser / Compile / jarjarPackageBinMappings) java.lang.NoSuchMethodError: org.pantsbuild.jarjar.JJProcessor.<init>(Lscala/collection/Seq;ZZLjava/lang/String;)V
(I have five shaded projects, one for each circe submodule I'm interested in using.)
I have followed the instructions on http://eed3si9n.com/jarjar-abrams and also looked at the sbt-test examples in this repository, but no luck.
Am I supposed to add a dependency on jarjar itself somewhere in my build, and if so where? (Presumably somewhere in project/ ?)
[0] Which I have gotten to work for SBT 1.2.8, but nothing beyond that.
@BardurArantsson Thanks for the report. Could you provide reproduction steps so I can reproduce your problem on my computer?
It might be a bit tricky since it's a proprietary project. I'll see if I can manage to make a minimal reproducer.
Ah... in trying to minimize a reproducer, I think I've found the problem. There was a different plugin which itself depended on sbt-assembly
0.14.7... which (I'm guessing) depends on a different jarjar version which is binary-incompatible. Ah, the joys of bincompat :).
So, this isn't a problem with jarjar-abrams per se... but maybe jarjar itself should be shaded just in case? (Getting a bit recursive, but since it's already bootstrapped it could be shaded using a different version of itself... or?)
Obviously, feel free to close this if you don't think it's worth shading jarjar :)