Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

org.hammerlab.sbt:deps

org.hammerlab.sbt:deps

SBT plugin providing dependency-management helpers:

addSbtPlugin("org.hammerlab.sbt" % "deps" % "5.0.0")

Dependency-DSL

Several syntaxes allow for easier dependency-configuration:

dep(
  guava             // regular library dependency
  scalatest tests,  // test-scoped dependency
  spark provided,   // `provided` dependency
  hadoop testtest,  // test-scoped dependency on -tests JAR
  kryo  +testtest   // combined `compile`- and `test->test`-scoped dependency
)

This uses aliases defined in parent, but inline coordinates can be used:

dep(
  "org.scalatest" ^^ "scalatest" ^ "3.0.0" tests
)

^ replaces the usual % because we are using the Dep DSL defined in this project's lib module instead of SBT's ModuleIDs (the former maintains some structure to the metadata that is lost by conversion to ModuleID).

Configuration-specific settings

Dedicated settings are available for common dependency-configurations as well:

              deps += guava
          testDeps += scalatest
      providedDeps += spark
      testTestDeps += hadoop
compileAndTestDeps += kryo

Global excludes

Exclude coordinates from all dependencies:

excludes += "javax.servlet" % "servlet-api"
excludes += "org.scalatest" %% "scalatest"   // cross-version syntax works!