Manage / exclude the underlying Play Framework dependency

We use play 2.1.1 (scala) and in some efforts to bind our dependencies, we found that several old depots are loaded directly into the playback framework.

in particular, oauth.signpost contains http components 4.0 (and, in turn, commons-codec 1.3), while we have other dependencies on http-componentsts 4.1 and commons-codec 1.6

the documentation seems pretty sparse in this area - at least in the older 1.2.x game .syml dependencies were somewhat more explicit, but I can not find the links for the current version 2.1.x.

I would not want futz with the Build.scala framework in $ {PLAY2_HOME} / framework / project to remove the dependency (we do not need oauth.signpost in this particular application), but for now this seems to be the only way.

any pointers?

(edit: I also ran into this: Play Framework 2.1 Remove the main dependency that is associated with a specific transitive dependency, which I would prefer to be able to do this by removing all the explicit dependency on the main structure)

+5
source share
2 answers

I don’t know how to eliminate the main dependency, but you can try to exclude transitive dependencies in your file Build.scala:

val appDependencies = Seq(
     ...
     ("oauth.signpost" % "signpost-commonshttp4" % "1.2.1.2") .exclude("org.apache.httpcomponents", "httpclient")
    )

or use the intransitive () method :

val appDependencies = Seq(
     ...
     ("oauth.signpost" % "signpost-commonshttp4" % "1.2.1.2") .intransitive()
    )

, .

+3

@nico_ekito!

, , :

val appDependencies = Seq(
  // play framework drags in quite a few deps we dont need. this is how we pare it back.
  ("play" %    "play_2.10" %   "2.1.1")
     .exclude("oauth.signpost", "signpost-core")
     .exclude("oauth.signpost","signpost-commonshttp4"),

  "com.github.tototoshi" %% "scala-csv" % "0.7.0",
  "se.radley" %% "play-plugins-salat" % "1.2",
  "org.specs2" %% "specs2" % "1.14" % "test"
)
+7

All Articles