Skip to content

sbt 1.0.2 publish with credentials fails to push jar and sources artefacts (for one of three subprojects) #3570

@akauppi

Description

@akauppi

This one is weird, and I likely won't be able to formulate it according to the contribution guidelines. But I think it's worth reporting in order to see whether others are seeing similar cases on-field as well.

In short:

  • upgrading one of my sbt projects (multiproject, with three subprojects) from sbt 0.13.15 to 1.0.2 causes one of the projects (always the same) to be only partially published (pom's are there, but jars and sources aren't) to the company's Nexus Maven repo

Screenshots:

screen shot 2017-09-21 at 11 41 58
Properly published subproject

screen shot 2017-09-21 at 11 41 36
Partial publish (no jars, no sources)

This happens for both release and snapshot publishes.

All subprojects share the same credentials setup:

def publishAs(name: String) = {
  val nexus = "https://maven.myCompany.net/"

  Def.settings(
    moduleName := name,
    publishMavenStyle := true,
    publishArtifact in (Compile, packageDoc) := false,
    publishTo := {
      if (isSnapshot.value) {
        Some("snapshots" at nexus + "content/repositories/snapshots")
      } else {
        Some("releases" at nexus + "content/repositories/releases")
      }
    },
    credentials ++= (for {
      user <- Option(System.getenv().get("MAVEN_USER"))
      pw <- Option(System.getenv().get("MAVEN_PASSWORD"))
    } yield Credentials("Sonatype Nexus Repository Manager", "maven.myCompany.net", user, pw)).toSeq
  )
}

All of this works, with 0.13.15 in project/build.properties. Changing to 1.0.2 makes publishing consistently fail.

On the command line one sees:

[error] (testkit/*:publish) java.io.IOException: PUT operation to URL https://maven.myCompany.net/content/repositories/snapshots/fi/myCompany/basement/cloak-akka-http-testkit_2.12/0.0.13-SNAPSHOT/cloak-akka-http-testkit_2.12-0.0.13-SNAPSHOT.jar failed with status code 502: Bad Gateway

The Nexus log show 401 (Unauthorized) for the failing parts.

My current work-around is simply to not upgrade to 1.0.2 within the particular project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions