java - sbt 版本从 Maven Central 中的文件夹结构生成

标签 java scala maven sbt

我正在尝试发布 library通过 sonatype 到 maven-central。 通过sbt +release发布时我成功上传了jar。 但文件夹结构是错误的: https://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")

发生错误:

tried [warn] 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 版本

关于java - sbt 版本从 Maven Central 中的文件夹结构生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49486163/

相关文章:

java - 使用 hibernate 的程序不会终止

java - 如何在一行中列出号码和联系人

scala - 为一组案例类动态填充一些属性

scala - elastic4s中找不到HttpClient?

android - 在更新的 Android 版本中导入旧项目

java - 如何在java中查找通用单链表的大小

java - 在android中的html字符串中添加一个新的html标签

scala - 作为自由单子(monad)的恒等单子(monad)

maven - -Dmaven.test.failure.ignore=true 设置,但在测试失败时构建仍然错误

java - Selenium 3.3.1 : NoDefClassFound (com. google.common.base.Function)