簡體   English   中英

sbt 版本從 maven 中心的文件夾結構生成

[英]sbt release generates from folder structure in maven central

我正在嘗試通過 sonatype 將發布到 maven-central。 通過sbt +release我成功上傳了 jar。 但是文件夾結構錯誤: https://repo1.maven.org/maven2/de/otto/jetty-ldap_2.10_0.13/0.1.1/ ://repo1.maven.org/maven2/de/otto/jetty-ldap_2.10_0.13/0.1.1/ 路徑中有sbt版本(0.13)。

使用這種結構,我無法將 jar 用作依賴項。 我這樣使用它: libraryDependencies ++= Seq( "de.otto" %% "jetty-ldap" % "0.1.1")

出現錯誤:

嘗試 [警告] https://repo1.maven.org/maven2/de/otto/jetty-ldap_2.11/0.1.1/jetty-ldap_2.11-0.1.1.pom

路徑顯然不匹配。 有人有什么想法嗎? 我有點迷失在這里..

我的 build.sbt 縮短了:

lazy val root = (project in file(".")).
settings(
    name := "jetty-ldap",
    organization := "de.otto",
    licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),

    homepage := Some(url("https://dev.otto.de/")),
    sbtPlugin := true
)
scalaVersion in ThisBuild := "2.12.5"
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
publishTo := {
    val nexus = "https://oss.sonatype.org/"
    if (version.value.trim.endsWith("SNAPSHOT")) {
        Some("snapshots" at nexus + "content/repositories/snapshots")
    } else {
        Some("releases" at nexus + "service/local/staging/deploy/maven2")
    }
}

crossSbtVersions := Vector("0.13.17", "1.1.0")

// From: https://github.com/xerial/sbt-sonatype#using-with-sbt-release-plugin
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
releaseCrossBuild := true
releaseProcess := Seq[ReleaseStep](
    checkSnapshotDependencies,
    inquireVersions,
    runClean,
    releaseStepCommandAndRemaining("^ test"),
    setReleaseVersion,
    commitReleaseVersion,
    tagRelease,
    releaseStepCommandAndRemaining("^ publishSigned"),
    setNextVersion,
    commitNextVersion,
    releaseStepCommand("sonatypeReleaseAll"),
    pushChanges
)

evgeny 的解決方案

要解決此問題,我們必須刪除sbtPlugin := true因為這會導致文件夾結構中出現 sbt 版本。

sbtPlugin := true你發布了 sbt 插件,對吧?

Sbt 插件在路徑中以 sbt 版本發布

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM