Guice currently embeds guava internally under a shaded classpath. We're in the process of changing that so it's a real dependency.
sam On Wed, Feb 12, 2014 at 12:28 PM, Ryan Asleson <[email protected]> wrote: > > But doesn't Guice 4.0 include the Guava libraries? And why does the > RequestScope work? I don't have Guava on my classpath. > > > On Wednesday, February 12, 2014 9:16:27 AM UTC-6, [email protected]: > >> You need to include the google guava jar. >> >> https://code.google.com/p/guava-libraries/ >> >> Peter >> >> >> On Wed, Feb 12, 2014 at 7:21 AM, Ryan Asleson <[email protected]> wrote: >> >>> >>> Hello, >>> >>> I'm applying Guice 4.0 beta 2 to a new project (I have some experience >>> with Guice 3.0) and I have a need for a custom scope, with which I have no >>> experience. I followed the instructions on the "Custom Scopes" wiki page, >>> however, there are errors in the code. These two lines in the SimpleScope >>> class cause errors: >>> >>> import static com.google.common.base.Preconditions.checkState; >>> import com.google.common.collect.Maps; >>> >>> >>> Looking within the guice-4.0-beta2.jar file, I see that the >>> com.google.common.base and com.google.common.collect packages are empty. >>> >>> I did find these two other classes within the jar and changed the import >>> statements to look like this: >>> >>> import com.google.inject.internal.guava.base.$Preconditions; >>> import com.google.inject.internal.guava.collect.$Maps; >>> >>> Is this correct? Are these the imports I should be using or should I >>> use something else? I tried looking at the source to the ServletScopes >>> class but it had the same imports that I referenced first. >>> >>> Thank you!! >>> >>> -Ryan >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "google-guice" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> >>> Visit this group at http://groups.google.com/group/google-guice. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/google-guice. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice. For more options, visit https://groups.google.com/groups/opt_out.
