mirror of https://github.com/sbt/sbt.git
Handle credentials key from global settings
This commit is contained in:
parent
2c6a6503f1
commit
73c5d9737d
|
|
@ -52,13 +52,17 @@ object SbtCoursierShared extends AutoPlugin {
|
|||
def publicationsSetting(packageConfigs: Seq[(sbt.Configuration, Configuration)]): Setting[_] =
|
||||
coursierPublications := ArtifactsTasks.coursierPublicationsTask(packageConfigs: _*).value
|
||||
|
||||
override def globalSettings: Seq[Setting[_]] =
|
||||
Seq(
|
||||
coursierUseSbtCredentials := true,
|
||||
coursierCredentials := Map.empty,
|
||||
coursierExtraCredentials := Nil
|
||||
)
|
||||
|
||||
override def buildSettings: Seq[Setting[_]] =
|
||||
Seq(
|
||||
coursierReorderResolvers := true,
|
||||
coursierKeepPreloaded := false,
|
||||
coursierUseSbtCredentials := true,
|
||||
coursierCredentials := Map.empty,
|
||||
coursierExtraCredentials := Nil,
|
||||
coursierLogger := None,
|
||||
coursierCache := CacheDefaults.location
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
scalaVersion := "2.11.8"
|
||||
|
||||
resolvers += "authenticated" at sys.env("TEST_REPOSITORY")
|
||||
|
||||
libraryDependencies += "com.abc" % "test" % "0.1"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
coursierExtraCredentials += coursier.credentials.Credentials(
|
||||
uri(sys.env("TEST_REPOSITORY")).getHost,
|
||||
sys.env("TEST_REPOSITORY_USER"),
|
||||
sys.env("TEST_REPOSITORY_PASSWORD")
|
||||
)
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
addSbtPlugin {
|
||||
|
||||
val name = sys.props.getOrElse(
|
||||
"plugin.name",
|
||||
sys.error("plugin.name Java property not set")
|
||||
)
|
||||
val version = sys.props.getOrElse(
|
||||
"plugin.version",
|
||||
sys.error("plugin.version Java property not set")
|
||||
)
|
||||
|
||||
"io.get-coursier" % name % version
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
object Main extends App
|
||||
|
|
@ -0,0 +1 @@
|
|||
> update
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
scalaVersion := "2.11.8"
|
||||
|
||||
resolvers += "authenticated" at sys.env("TEST_REPOSITORY")
|
||||
|
||||
libraryDependencies += "com.abc" % "test" % "0.1"
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
coursierUseSbtCredentials := true
|
||||
credentials += Credentials(
|
||||
"",
|
||||
sys.env("TEST_REPOSITORY_HOST"),
|
||||
sys.env("TEST_REPOSITORY_USER"),
|
||||
sys.env("TEST_REPOSITORY_PASSWORD")
|
||||
)
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
addSbtPlugin {
|
||||
|
||||
val name = sys.props.getOrElse(
|
||||
"plugin.name",
|
||||
sys.error("plugin.name Java property not set")
|
||||
)
|
||||
val version = sys.props.getOrElse(
|
||||
"plugin.version",
|
||||
sys.error("plugin.version Java property not set")
|
||||
)
|
||||
|
||||
"io.get-coursier" % name % version
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
object Main extends App
|
||||
|
|
@ -0,0 +1 @@
|
|||
> update
|
||||
Loading…
Reference in New Issue