mecano1 / vogar

Automatically exported from code.google.com/p/vogar
1 stars 0 forks source link

Using vogar with a jar that also includes com.google.common causes duplicate def errors #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a work-around, so reporting this mostly so you're aware. Feel free to 
ignore/close if it's not important to you.

While running vogar, I got errors like this:
  UNEXPECTED TOP-LEVEL EXCEPTION:
  java.lang.IllegalArgumentException: already added: Lcom/google/common/annotations/Beta;

I tracked it down to some other code also including Guava. The fix was easy (I 
repackage com.google.common in vogar.jar), but it was unexpected that the vogar 
(and/or caliper) harness was being compiled into my code.

The fix may just be better documentation (prefer compiling vogar yourself to 
using vogar.jar), or maybe the jar should come repackaged?

Command I ran was:
java -jar vogar.jar --benchmark --classpath third_party.jar --sourcepath src 
path/to/my/Benchmark.java

Original issue reported on code.google.com by nkano...@google.com on 19 Jun 2012 at 9:09