Publish-to now accepts jvm property publish.maven.central to rewire resolver to be aven central.
This commit is contained in:
parent
04159dc931
commit
1be260c283
1 changed files with 18 additions and 4 deletions
|
|
@ -67,13 +67,27 @@ object Publish {
|
|||
}
|
||||
|
||||
def akkaPublishTo: Initialize[Option[Resolver]] = {
|
||||
defaultPublishTo { default =>
|
||||
val property = Option(System.getProperty("akka.publish.repository"))
|
||||
val repo = property map { "Akka Publish Repository" at _ }
|
||||
repo orElse Some(Resolver.file("Default Local Repository", default))
|
||||
(defaultPublishTo, version) { (default, v) =>
|
||||
akkaPublishRepository orElse
|
||||
sonatypeRepo(v) orElse
|
||||
Some(Resolver.file("Default Local Repository", default))
|
||||
}
|
||||
}
|
||||
|
||||
def sonatypeRepo(version: String): Option[Resolver] = {
|
||||
Option(sys.props("publish.maven.central")) filter (_.toLowerCase == "true") map { _ =>
|
||||
val nexus = "https://oss.sonatype.org/"
|
||||
if(version endsWith "-SNAPSHOT") ("snapshots" at nexus + "content/repositories/snapshots")
|
||||
else ("releases" at nexus + "service/local/staging/deploy/maven2")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def akkaPublishRepository: Option[Resolver] = {
|
||||
val property = Option(System.getProperty("akka.publish.repository"))
|
||||
property map { "Akka Publish Repository" at _ }
|
||||
}
|
||||
|
||||
def akkaCredentials: Seq[Credentials] = {
|
||||
val property = Option(System.getProperty("akka.publish.credentials"))
|
||||
property map (f => Credentials(new File(f))) toSeq
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue