fr3dch3n
fr3dch3n

Reputation: 429

sbt release generates from folder structure in maven central

I'm trying to release a library via sonatype to maven-central. When releasing via sbt +release I successfully upload the jar. But the folder structure is wrong: https://repo1.maven.org/maven2/de/otto/jetty-ldap_2.10_0.13/0.1.1/ There is the sbt version in the path (0.13).

With this structure I am not able to use the jar as a dependency. I use it like this: libraryDependencies ++= Seq( "de.otto" %% "jetty-ldap" % "0.1.1")

An error occurs:

tried [warn] https://repo1.maven.org/maven2/de/otto/jetty-ldap_2.11/0.1.1/jetty-ldap_2.11-0.1.1.pom

The paths obviously don't match. Does someone have any ideas? I am kinda lost here..

My build.sbt shortened:

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
)

Solution by evgeny

To resolve the issue, we had to remove the line sbtPlugin := true since this results in an sbt-version in the folder-structure.

Upvotes: 0

Views: 153

Answers (1)

Evgeny
Evgeny

Reputation: 1770

sbtPlugin := true you publish sbt plugin, right?

Sbt plugin is published with sbt version in path

Upvotes: 1

Related Questions