play-plugins icon indicating copy to clipboard operation
play-plugins copied to clipboard

guice-annotations utils dependency breaks jclouds and other guice 3.0-dependent libs

Open eboto opened this issue 13 years ago • 2 comments

I believe that including the guice-annotations project on the classpath breaks any libraries that use Guice 3.0. I believe that it does this by providing incompatible Provider annotation implementations.

This is a problem because this repo's utils package uses guice-annotations. Is it possible to remove or update that dependency?

To reproduce:

  • Clone this Play 2.0.4 project that uses the cedarsoft dependency directly as well as the latest jclouds.
  • Run the project and hit localhost:9000 in your browser
  • Observe the massive Guice stacktrace in your play2 console
  • Uncomment the libraryDependency on guice-annotations in Build.scala
  • Run the project and hit localhost:9000 again.
  • Observe that the page is rendered without a stack trace.

eboto avatar Oct 08 '12 00:10 eboto

I encountered this problem in my Play 2.1.0 Java project when using play-plugins-mailer 2.1.0. I solved it as follows:

(in Build.scala)

    val appDependencies = Seq(
      javaCore, javaEbean,
      // Add project dependencies here
      "com.google.inject" % "guice" % "3.0",
      "com.google.inject.extensions" % "guice-assistedinject" % "3.0",
      "com.google.code.morphia" % "morphia" % "0.99",
      "com.google.code.morphia" % "morphia-logging-slf4j" % "0.99",
      "org.mongodb" % "mongo-java-driver" % "2.10.1",
      "com.yammer.metrics" % "metrics-core" % "2.2.0",
      "com.palominolabs.metrics" % "metrics-guice" % "2.1.3",
      "com.jcraft" % "jsch" % "0.1.46",

      // As of 2.1.0, play-plugins-util slurps in com.cedarsoft:guice-annotations
      // which has a conflicting com.google.inject.Provider interface
      "com.typesafe" %% "play-plugins-mailer" % "2.1.0" exclude("com.cedarsoft", "guice-annotations")

That said, I don't understand why play-plugin-utils includes com.cedarsoft:guice-annotations at all. Was it for the now-obsolete guice plugin? It looks like this should be cleaned up.

kangas avatar Mar 13 '13 16:03 kangas

Good question, I'll look into it.

jroper avatar Mar 18 '13 02:03 jroper