mirror of https://github.com/sbt/sbt.git
Adds addMavenResolverPlugin. #1808/#1793
This commit is contained in:
parent
69171f40b3
commit
f42419bdd4
|
|
@ -468,8 +468,7 @@ def otherRootSettings = Seq(
|
|||
Scripted.scriptedPrescripted := { f =>
|
||||
val inj = f / "project" / "maven.sbt"
|
||||
if (!inj.exists) {
|
||||
IO.write(inj, """libraryDependencies += Defaults.sbtPluginExtra("org.scala-sbt" % "sbt-maven-resolver" % sbtVersion.value,
|
||||
|sbtBinaryVersion.value, scalaBinaryVersion.value)""".stripMargin)
|
||||
IO.write(inj, "addMavenResolverPlugin")
|
||||
// sLog.value.info(s"""Injected project/maven.sbt to $f""")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1778,6 +1778,12 @@ trait BuildExtra extends BuildCommon with DefExtra {
|
|||
Seq(compose(onLoad, add), compose(onUnload, remove))
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds Maven resolver plugin.
|
||||
*/
|
||||
def addMavenResolverPlugin: Setting[Seq[ModuleID]] =
|
||||
libraryDependencies += sbtPluginExtra(ModuleID("org.scala-sbt", "sbt-maven-resolver", sbtVersion.value), sbtBinaryVersion.value, scalaBinaryVersion.value)
|
||||
|
||||
/**
|
||||
* Adds `dependency` as an sbt plugin for the specific sbt version `sbtVersion` and Scala version `scalaVersion`.
|
||||
* Typically, use the default values for these versions instead of specifying them explicitly.
|
||||
|
|
|
|||
|
|
@ -101,8 +101,7 @@ to resolve Maven dependencies instead of Apache Ivy.
|
|||
|
||||
To enable this plugin, add the following to `project/maven.sbt` (or `project/plugin.sbt` the file name doesn't matter):
|
||||
|
||||
libraryDependencies += Defaults.sbtPluginExtra("org.scala-sbt" % "sbt-maven-resolver" % sbtVersion.value,
|
||||
sbtBinaryVersion.value, scalaBinaryVersion.value)
|
||||
addMavenResolverPlugin
|
||||
|
||||
This will create a new `~/.ivy2/maven-cache` directory, which contains the Aether cache of files.
|
||||
You may notice some file will be re-downloaded for the new cache layout.
|
||||
|
|
|
|||
Loading…
Reference in New Issue