用于在 bintray 中发布的 Sbt

标签 sbt bintray

我有下一个配置:

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)
    )
  )

我想将其发布到 bintray 中。

我愿意 publish但我有错误:
    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)

我用的是 bintray-sbt plugin .

谢谢

最佳答案

请参阅自述文件:

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


你可能需要这样的东西。

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)
  )

关于用于在 bintray 中发布的 Sbt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23081609/

相关文章:

scala - 为什么 Spark 应用程序以 "ClassNotFoundException: Failed to find data source: jdbc"作为带有 sbt 程序集的 uber-jar 失败?

scala - build.sbt : how to add spark dependencies

scala - 启动使用 one-jar 创建的 jar 时出错

Gradle 无法解析我的私有(private) bintray 工件

scala - IDEA中的scalatest编译错误

java - Bintray gradle 插件不上传 Artifact

android - 将我的 android aar 发布到 jcenter

android-studio - 如何在没有源的情况下将 android 库模块发布到 jcenter?

android - 如何将本地 aar 依赖项添加到 bintray 发布的库中?

SBT 配置无法在 Typesafe Activator 中加载