-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix computation of sonatypeDefaultResolver for Sonatype Central
- Loading branch information
Showing
4 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
sonatypeCredentialHost := xerial.sbt.sonatype.SonatypeCentralClient.host | ||
|
||
val checkSonatypeDefaultResolver = taskKey[Unit]("Check if the default resolver is Sonatype") | ||
checkSonatypeDefaultResolver := { | ||
val actual = sonatypeDefaultResolver.value | ||
val expected = Resolver.url("https://central.sonatype.com") | ||
require(actual == expected, s"expected $actual to be $expected") | ||
} |
8 changes: 8 additions & 0 deletions
8
src/sbt-test/sbt-sonatype/sonatype-central-host/project/plugins.sbt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
val pluginVersion = System.getProperty("plugin.version") | ||
if (pluginVersion == null) | ||
throw new RuntimeException("""|The system property 'plugin.version' is not defined. | ||
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin) | ||
else | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % pluginVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
> checkSonatypeDefaultResolver |