Hey Guys,

caveats: I¹m using eclipse luna on OSX, kubuntu 14.04, and windows 7.

I was asked by @EverettToews to post about my issues surrounding use of
AutoValue and what was learned in having solved those issues Š so here I
go. 

The problem arose when checking out jclouds-docker (though this could have
been any of the jclouds projects) and then importing it into eclipse.
Going about the usual eclipse/AutoValue setup I quickly realized things
were not working in the normal way (I¹ll explain what ¹normal way¹ means
in this context below). Meaning that importing the AutoValue-1.0-rc2 jar
into eclipses annotation processor was not just-working. I assumed this an
issue with the project itself, or how it¹s setup or configured, as I¹ve
successfully used AutoValue for other projects within eclipse and had
those just-work. On my OSX machine importing AutoValue into eclipse sent
it into an infinite loop trying to rebuild the project. Doing the same on
my kubuntu/windows machines the project just failed to build due to
missing dependencies. Adding each of these to the annotation processor
path eventually got me to a working solution but it¹s a far cry from
having to import only 1 AutoValue jar. The same success was eventually had
using OSX if I imported each of these dependencies first without
attempting to rebuild the project after each jar was added.

So I came to a working solution across the board but was still plagued as
to why this worked in our other projects we have but for jclouds it was
not just-working. It hit me that really the only thing that was different
was the means of dependency management: in our case was gradle in jclouds
this is maven. Converting the aforementioned jclouds project into a gradle
build AutoValue worked as expected. Going back to maven and I had to
import all the necessary deps. As I assume others have been using eclipse,
and importing just the 1 AutoValue jar, and having things work as
expected, my hunch is that this is an eclipse-luna issue, and WRT to
annotation processor deps, and may not be seen in prior versions though I
have yet to test that myself.

Lessons learned? If you¹re using a newer version of eclipse, and maven to
manage your deps, it¹s possible you may have to add multiple dependencies
to the eclipse annotation processor to get it to stop complaining about
AutoValue (and in the case of OSX add ALL those dependencies without
rebuilding between additions). And if you¹re using eclipse, with gradle
handling your AutoValue deps, then things just work ;)

Thanks,
Chris
>

Reply via email to