question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:47 (26 by maintainers)

github_iconTop GitHub Comments

16reactions
eed3si9ncommented, Sep 28, 2017

A workaround might be:

updateOptions := updateOptions.value.withGigahorse(false)

That should fallback to similar behavior as 0.13.

4reactions
avdvcommented, Apr 13, 2019

Maybe make gigahorse opt-in instead of opt-out?!

Read more comments on GitHub >

github_iconTop Results From Across the Web

sbt 1.0.2 publish with credentials fails to push jar and sources ...
sbt 1.0.2 publish with credentials fails to push jar and sources artefacts (for one of three subprojects)
Read more >
sbt/sbt - Gitter
Trying to do publishLocal with sbt 1.0.3, if I add sources in (Compile, ... @szeiger had a talk that went through publishing at...
Read more >
sbt Reference Manual — Publishing
This page describes how to publish your project. Publishing consists of uploading a descriptor, such as an Ivy file or Maven POM, and...
Read more >
Publish SBT project with sub-projects as a single Maven artifact
You can take a look at sbt-assembly plugin which creates fat jar (includes all the dependencies) of your project.
Read more >
Scala (SBT) Publishing to Github Packages - Steven Skelton
Scala artifacts are usually stored in a Maven compatible ... to how Docker creates an easy deploy with just 1 file, an über...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found