Sbt for publish in bintray
Asked Answered
B

2

6

I have the next configuration:

lazy val mainProject = Project(
    id = "project-helper",
    base = file("."),
    settings = Project.defaultSettings ++ Seq(
      name := "my-first-project",
      version := "0.1-SNAPSHOT",
      scalaVersion := "2.10.2",
      licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
      publishMavenStyle := false,
      pomExtra := pomXml,
      publishArtifact in Test := false,
      resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases",
      libraryDependencies ++= Seq(
        "org.scala-lang"    %  "scala-reflect"   % "2.10.3",
        "org.scalamacros"   %  "quasiquotes_2.10.3" % "2.0.0-M3"
      ),
      addCompilerPlugin("org.scalamacros" % "paradise" % "2.0.0-M3" cross CrossVersion.full)
    )
  )

I want publish this into a bintray.

I do publish but i got error:

    java.lang.RuntimeException: Repository for publishing is not specified.
at scala.sys.package$.error(package.scala:27)
at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1203)
at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1203)
at scala.Option.getOrElse(Option.scala:120)

I use a bintray-sbt plugin.

Thanks

Blackmarketeer answered 15/4, 2014 at 10:55 Comment(0)
D
6

See the README:

Publishing

To publish a package to bintray, you need a bintray account. You can do so here. After creating a bintray account you can add

seq(bintrayPublishSettings:_*)

You likely need something like this.

import bintray.Plugin._

lazy val mainProject = Project(id = "project-helper", base = file(".")).
  settings(bintrayPublishSettings: _*).
  settings(
    name := "my-first-project",
    version := "0.1-SNAPSHOT",
    scalaVersion := "2.10.2",
    licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
    publishMavenStyle := false,
    pomExtra := pomXml,
    publishArtifact in Test := false,
    resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases",
    libraryDependencies ++= Seq(
      "org.scala-lang"    %  "scala-reflect"   % "2.10.3",
      "org.scalamacros"   %  "quasiquotes_2.10.3" % "2.0.0-M3"
    ),
    addCompilerPlugin("org.scalamacros" % "paradise" % "2.0.0-M3" cross CrossVersion.full)
  )
Dennett answered 15/4, 2014 at 22:36 Comment(0)
R
0

Same way (but different) could be to just append to settings:

++ bintray.Plugin.bintraySettings
Roan answered 20/2, 2015 at 1:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.