Deploys sbt-artifacts using Eclipse aether. Aether is the same library as maven itself uses, meaning that the same behaviour should be expected.
...
addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % "0.10")
...
import aether.Aether._
publishTo <<= (version: String) {
if (version.endsWith("SNAPSHOT") {
Some("Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
}
else {
Some("Sonatype Nexus Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
}
seq(aetherSettings: _*)
seq(aetherPublishSettings: _*)
credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
To deploy to remote Maven repository.
sbt aether-deploy
To deploy to local maven repository.
sbt aether-install
To deploy to remote Maven repository.
sbt publish
To deploy to local maven repository.
sbt publish-local
Documentation for proxies can be found here
Previously the sbt-pgp-plugin hooked into the published-artifacts task, and this plugin does the same. This is no longer the case.
seq(aetherSettings: _*)
aetherArtifact <<= (coordinates, Keys.`package` in Compile, makePom in Compile, com.typesafe.sbt.pgp.PgpKeys.signedArtifacts in Compile) map {
(coords: aether.MavenCoordinates, mainArtifact: File, pom: File, artifacts: Map[Artifact, File]) =>
aether.Aether.createArtifact(artifacts, pom, coords, mainArtifact)
}
This should now allow aether-deploy task to work with the sbt-pgp-plugin
publishSigned <<= deploy
To use the plugin in a .scala file you have to import it like this:
import aether.Aether._