Code Monkey home page Code Monkey logo

sbt-aether-deploy's Introduction

SBT aether deploy plugin

Deploys sbt-artifacts using Eclipse aether. Aether is the same library as maven itself uses, meaning that the same behaviour should be expected.

project/plugins.sbt

...
addSbtPlugin("no.arktekk.sbt" % "aether-deploy" % "0.10")
...

Build file

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: _*)

Override default publish/publish-local task

seq(aetherPublishSettings: _*)

Add credentials

credentials += Credentials(Path.userHome / ".sbt" / ".credentials")

Usage

To deploy to remote Maven repository.

sbt aether-deploy

To deploy to local maven repository.

sbt aether-install

Usage if the publish/publish-local task is overriden

To deploy to remote Maven repository.

sbt publish

To deploy to local maven repository.

sbt publish-local

Proxies

Documentation for proxies can be found here

Using the plugin with sbt-pgp-plugin 0.8

Previously the sbt-pgp-plugin hooked into the published-artifacts task, and this plugin does the same. This is no longer the case.

Workaround until code is updated

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

Overriding the publish-signed task

publishSigned <<= deploy

Using .scala file

To use the plugin in a .scala file you have to import it like this:

import aether.Aether._

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.