Giter Club home page Giter Club logo

sbt-sonatype's Introduction

sbt-sonatype plugin

A sbt plugin for publishing your project to the Maven central repository through the REST API of Sonatype Nexus. Deploying artifacts to Sonatype repository is a requirement for synchronizing your projects to the Maven central repository. sbt-sonatype plugin enables two-step release of your Scala/Java projects.

  • publishSigned (with sbt-pgp plugin)
    • Create GPG signed artifacts to a local staging repository.
    • Make sure adding publishTo := sonatypePublishToBundle.value to your build.sbt
  • sonatypeBundleRelease (New in sbt-sonatype 3.4)
    • This command will prepare a new remote staging repository at Sonatype. If there are existing staging repositories that have the same description with sonatypeSessionName key, sbt-sonatype will discard them properly.
    • Then, it will upload the artifacts in the local staging folder to the remote staging repository. Uploading artifacts as a bundle is much faster than uploading each artifact to Sonatype. For example, thousands of files can be uploaded in several minutes with bundle upload.
    • Finally, this command will perform the close and release steps at the Sonatype Nexus repository to meet the Maven central requirements.

After these steps, your project will be synchronized to the Maven central within ten minutes. No longer need to enter the web interface of Sonatype Nexus repository to perform these release steps.

Prerequisites

Configurations

Maven Central

project/plugins.sbt

Import sbt-sonatype plugin and sbt-pgp plugin to use sonatypeBundleRelease and publishSigned commands:

// For sbt 1.x (sbt-sonatype 2.3 or higher)
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "(version)")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")

// For sbt 0.13.x (upto sbt-sonatype 2.3)
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "(version)")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")

build.sbt

To use sbt-sonatype, you need to create a bundle of your project artifacts (e.g., .jar, .javadoc, .asc files, etc.) into a local folder specified by sonatypeBundleDirectory. By default, the folder is (project root)/target/sonatype-staging/(version). Add the following publishTo setting to create a local bundle of your project:

publishTo := sonatypePublishToBundle.value

⚠️ Legacy Host

By default, this plugin is configured to use the legacy Sonatype repository oss.sonatype.org. If you created a new account on or after February 2021, add sonatypeCredentialHost settings:

// For all Sonatype accounts created on or after February 2021
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"

With this setting, publishSigned will create a bundle of your project to the local staging folder. If the project has multiple modules, all of the artifacts will be assembled into the same folder to create a single bundle.

If isSnapshot.value is true (e.g., if the version name contains -SNAPSHOT), publishSigned task will upload files to the Sonatype Snapshots repository without using the local bundle folder.

If necessary, you can tweak several configurations:

// [Optional] The local staging folder name:
sonatypeBundleDirectory := (ThisBuild / baseDirectory).value / target.value.getName / "sonatype-staging" / (ThisBuild / version).value

// [Optional] If you need to manage unique session names by yourself, change this default setting:
sonatypeSessionName := s"[sbt-sonatype] ${name.value} ${version.value}"

// [Optional] Timeout until giving up sonatype close/promote stages. Default is 60 min.
sonatypeTimeoutMillis := 60 * 60 * 1000 

// [If you cannot use bundle upload] Use this setting when you need to uploads artifacts directly to Sonatype
// With this setting, you cannot use sonatypeBundleXXX commands
publishTo := sonatypePublishTo.value

// [If necessary] Settings for using custom Nexus repositories:
sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"

$HOME/.sbt/(sbt-version 0.13 or 1.0)/sonatype.sbt

For the authentication to Sonatype API, you need to set your Sonatype account information (user name and password) in the global sbt settings. To protect your password, never include this file within your project.

credentials += Credentials("Sonatype Nexus Repository Manager",
        "oss.sonatype.org",
        "(Sonatype user name)",
        "(Sonatype password)")

(project root)/sonatype.sbt

sbt-sonatype is an auto-plugin, which will automatically configure your build. There are a few settings though that you need to define by yourself:

  • sonatypeProfileName
    • This is your Sonatype account profile name, e.g. org.xerial. If you do not set this value, it will be the same with the organization value.
  • pomExtra

Example settings:

// Your profile name of the sonatype account. The default is the same with the organization value
sonatypeProfileName := "(your organization. e.g., org.xerial)"

// To sync with Maven central, you need to supply the following information:
publishMavenStyle := true

// Open-source license of your choice
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))

// Where is the source code hosted: GitHub or GitLab?
import xerial.sbt.Sonatype._
sonatypeProjectHosting := Some(GitHubHosting("username", "projectName", "[email protected]"))
// or
sonatypeProjectHosting := Some(GitLabHosting("username", "projectName", "[email protected]"))

// or if you want to set these fields manually
homepage := Some(url("https://(your project url)"))
scmInfo := Some(
  ScmInfo(
    url("https://github.com/(account)/(project)"),
    "scm:[email protected]:(account)/(project).git"
  )
)
developers := List(
  Developer(id="(your id)", name="(your name)", email="(your e-mail)", url=url("(your home page)"))
)

Publishing Your Artifact

The basic steps for publishing your artifact to the Central Repository are as follows:

  • publishSigned to deploy your artifact to a local staging repository.
  • sonatypeBundleRelease (since sbt-sonatype 3.4)
    • This command is equivalent to running ; sonatypePrepare; sonatypeBundleUpload; sonatypeRelease.
    • Internally sonatypeRelease will do sonatypeClose and sonatypePromote in one step.
      • sonatypeClose closes your staging repository at Sonatype. This step verifies Maven central sync requirement, GPG-signature, javadoc and source code presence, pom.xml settings, etc.
      • sonatypePromote command verifies the closed repository so that it can be synchronized with Maven central.

Note: If your project version has "SNAPSHOT" suffix, your project will be published to the snapshot repository of Sonatype, and you cannot use sonatypeBundleUpload or sonatypeRelease command.

Commands

Usually, we only need to run sonatypeBundleRelease command in sbt-sonatype:

  • sonatypeBundleRelease
    • This will run a sequence of commands ; sonatypePrepare; sonatypeBundleUpload; sonatypeRelease in one step.
    • You must run publishSigned before this command to create a local staging bundle.

Individual Step Commands

  • sonatypePrepare
    • Drop the existing staging repositories (if exist) and create a new staging repository using sonatypeSessionName as a unique key.
    • This will update sonatypePublishTo setting.
    • For cross-build projects, make sure running this command only once at the beginning of the release process.
      • Usually using sonatypeBundleUpload should be sufficient, but if you need to parallelize artifact uploads, run sonatypeOpen before each upload to reuse the already created stging repository.
  • sonatypeBundleUpload
    • Upload your local staging folder contents to a remote Sonatype repository.
  • sonatypeOpen
    • This command is necessary only when you need to parallelize publishSigned task. For small/medium-size projects, using only sonatypePrepare would work.
    • This opens the existing staging repository using sonatypeSessionName as a unique key. If it doesn't exist, create a new one. It will updatesonatypePublishTo
  • sonatypeRelease (repositoryId)?
    • Close (if needed) and promote a staging repository. After this command, the uploaded artifacts will be synchronized to Maven central.

Batch Operations

  • sonatypeDropAll (sonatypeProfileName)?
    • Drop all staging repositories.
  • sonatypeReleaseAll (sonatypeProfileName)?
    • Close and promote all staging repositories (Useful for cross-building projects)

Other Commands

  • sonatypeBundleClean
    • Clean a local bundle folder
  • sonatypeClean
    • Clean a remote staging repository which has sonatypeSessionName key.
  • sonatypeStagingProfiles
    • Show the list of staging profiles, which include profileName information.
  • sonatypeLog
    • Show the staging activity logs
  • sonatypeClose
    • Close the open staging repository (= requirement verification)
  • sonatypePromote
    • Promote the closed staging repository (= sync to Maven central)
  • sonatypeDrop
    • Drop an open or closed staging repository

Advanced Build Settings

Sequential Upload Release (Use this for small projects)

> ; publishSigned; sonatypeBundleRelease

For cross-building projects, use + publishSigned:

> ; + publishSigned; sonatypeBundleRelease

Parallelizing Builds When Sharing A Working Folder

When you are sharing a working folder, you can parallelize publishSigned step for each module or for each Scala binary version:

  • Run multiple publishSigned tasks in parallel
  • Finally, run sonatypeBundleRelease

Parallelizing Builds When Not Sharing Any Working Folder

If you are not sharing any working directory (e.g., Travis CI), to parallelize the release process, you need to publish a bundle for each build because Sonatype API only supports uploading one bundle per a staging repository.

Here is an example to parallelize your build for each Scala binary version:

  • Set sonatypeSessionName := "[sbt-sonatype] ${name.value}-${scalaBinaryVersion.value}-${version.value}" to use unique session keys for individual Scala binary versions.
  • For each Scala version, run: sbt ++(Scala version) "; publishSigned; sonatypeBundleRelease"

For sbt-sonatype 2.x:

Using with sbt-release plugin

To perform publishSigned and sonatypeBundleRelease with sbt-release plugin, define your custom release process as follows:

import ReleaseTransformations._

releaseCrossBuild := true // true if you cross-build the project for multiple Scala versions
releaseProcess := Seq[ReleaseStep](
  checkSnapshotDependencies,
  inquireVersions,
  runClean,
  runTest,
  setReleaseVersion,
  commitReleaseVersion,
  tagRelease,
  // For non cross-build projects, use releaseStepCommand("publishSigned")
  releaseStepCommandAndRemaining("+publishSigned"),
  releaseStepCommand("sonatypeBundleRelease"),
  setNextVersion,
  commitNextVersion,
  pushChanges
)

Publishing Maven Projects

If your Maven project (including Gradle, etc.) is already deployed to the staging repository of Sonatype, you can use sbt sonatypeReleaseAll (sonatypeProfileName) command for the synchronization to the Maven central (Since version 0.5.1).

Prepare the following two files:

$HOME/.sbt/(sbt-version 0.13 or 1.0)/plugins/plugins.sbt

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "(version)")

$HOME/.sbt/(sbt-version 0.13 or 1.0)/sonatype.sbt

credentials += Credentials("Sonatype Nexus Repository Manager",
        "oss.sonatype.org",
        "(Sonatype user name)",
        "(Sonatype password)")

Alternatively, the credentials can also be set with the environment variables SONATYPE_USERNAME and SONATYPE_PASSWORD.

Then, run sonatypeReleaseAll command by specifying your sonatypeProfileName. If this is org.xerial, run:

$ sbt "sonatypeReleaseAll org.xerial"

For sbt-sonatype developers

Releasing sbt-sonatype to Sonatype:

## Add a new git tag
$ git tag v3.9.x
$ ./sbt
> publishSigned
> sonatypeBundleRelease
```

sbt-sonatype's People

Contributors

alexduf avatar armanbilge avatar atooni avatar atry avatar bardurarantsson avatar bhargavshirin avatar blast-hardcheese avatar dependabot[bot] avatar dos65 avatar hugo-vrijswijk avatar j5ik2o avatar jroper avatar leonardehrenfried avatar magnolia-k avatar metasim avatar mosabua avatar nicolasrouquette avatar olafurpg avatar priteshjadhav132 avatar raboof avatar rtyley avatar scala-steward avatar steinybot avatar tkawachi avatar xerial avatar xerial-bot avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbt-sonatype's Issues

Problem releasing multiple libraries in parallel

Sometimes I have problems because two libraries are publishing at the same time and it fails due to repositories existing for the same profile.

How can I run sonatypeRelease for only the repository I just run publishSigned?

sonatypeProfileName doesn't exist

[info] Loading global plugins from .../.sbt/0.13/plugins
.../.sbt/0.13/sonatype.sbt:29: error: not found: value sonatypeProfileName
sonatypeProfileName := "..."
^
[error] Type error in expression

add support for staging repository description PUT/GET

According to Sonatype:

The request to update a staging repository's description is a PUT request to:

http://{nexus-host}/nexus/service/local/staging/repository/{repository-id}

The payload looks like this:

{"repositoryId":"<insert staging repository id here>","description":"<insert current description here to preserve it>"}

Make a GET call first to get the existing description value.

No staging repository found

When I run publishSigned and then sonatypeReleaseAll I now get the below after upgrading versions.

publishSinged emits no errors and I can see the files in target. Not sure how to continue troubleshooting this.

Using version sbt-sonatype 1.1 and sbt-pgp 1.0.0 with sbt 0.13.11.


sbt-templates> sonatypeReleaseAll
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] sonatypeProfileName = org.mollyware
[info] Reading staging repository profiles...
[warn] No staging repository is found. Do publishSigned first.

Remove excessive coupling between sonatype commands and publishSigned

In my experience, there's an indirect dependency between publishSigned and all the sonatype commands, meaning that if publishSigned is executed concurrently the whole sonatype release will fail, detecting changes coming from other repositories.

I don't know why this is done this way, and I couldn't find the exact way it's done (I think you're polling the repo info from xml files created by publishSigned?), but I think this is undesirable:

  1. It forces a logical dependency between the two, when they can be decoupled.
  2. It prevents, by nature, concurrent execution of tasks.

Is there any way we can remove such decoupling? I find the way sbt-bintray handles releases ideal. bintrayRelease is completely independent of publishSigned, and can be executed concurrently.

Maybe the solution to all this is to get rid of the commands and just have tasks, as bintray does...

No staging profile found error

I'm trying to deploy artifacts within the organisation net.kemitix.thorp, using my existing sonatype profile net.kemitix. However, I keep getting the error No staging profile found for net.kemitix.thorp. I have set both organization and sonatypeProfileName, but the profile name is being ignored.

I'm concerned that this line might be causing my setting to be ignored.

Project does not explicitly define a license

Certain source files are commented with the Apache 2.0 license header, but the project itself does not declare the Apache 2.0 license. Regardless of which license the project wishes to use, it should be in the root of the repository in a LICENSE text file.

Display activity logs when releasing

Display activity logs when running sonatypeRelease command.

[info] Activity open started:2014-02-26T19:08:57.993-06:00, stopped:2014-02-26T19:09:01.464-06:00
[info] Activity close started:2014-02-26T19:14:11.181-06:00, stopped:2014-02-26T19:14:19.428-06:00
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]     Passed: checksum-staging
[info]     Passed: pom-staging
[info]     Passed: javadoc-staging
[info]     Passed: signature-staging
[info]     Passed: sources-staging
[info]     Passed: id:5e9e8e6f8d20a3
[info]   Evaluate: id:nx-internal-ruleset, rule:RepositoryWritePolicy
[info]     Passed: RepositoryWritePolicy
[info]     Passed: id:nx-internal-ruleset
[info]      email: to:[email protected]

do not set publishTo by default

I used to have this plugin in my global config until I realized that it overrides the publishTo I have setup for my individual projects to point to sonatype. That's not desirable for me. I only want the sonatype commands, but decide depending on the project if I publish repositories to sonatype, bintray or other places.

Occasional SAXParseException

sbt-sonatype occasionally throws a SAXParseException:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
[info] Loading settings for project binding-scala-build-build from plugins.sbt ...
[info] Loading project definition from /home/travis/build/ThoughtWorksInc/Binding.scala/project/project
[info] Loading settings for project binding-scala-build from coursier.sbt,plugins.sbt ...
[info] Loading project definition from /home/travis/build/ThoughtWorksInc/Binding.scala/project
[info] Loading settings for project fxmlJVM from build.sbt ...
[info] Loading settings for project fxmlJS from build.sbt ...
[info] Loading settings for project XmlExtractorJVM from build.sbt ...
[info] Loading settings for project XmlExtractorJS from build.sbt ...
[info] Loading settings for project FutureBindingJVM from build.sbt ...
[info] Loading settings for project FutureBindingJS from build.sbt ...
[info] Loading settings for project BindingJVM from build.sbt ...
[info] Loading settings for project BindingJS from build.sbt ...
[info] Loading settings for project SafeBufferJVM from build.sbt ...
[info] Loading settings for project SafeBufferJS from build.sbt ...
[info] Loading settings for project JsPromiseBinding from build.sbt ...
[info] Loading settings for project Route from build.sbt ...
[info] Loading settings for project dom from build.sbt ...
[info] Loading settings for project secret from secret.sbt ...
[info] Loading settings for project binding-scala from build.sbt,dynver-dash-separator.sbt,secret.sbt ...
[info] Resolving key references (10173 settings) ...
[info] Set current project to binding-scala (in build file:/home/travis/build/ThoughtWorksInc/Binding.scala/)
[info] Setting Scala version to 2.11.12 on 14 projects.
[info] Excluded 1 projects, run ++ 2.11.12 -v for more details.
[info] Reapplying settings...
[info] Set current project to binding-scala (in build file:/home/travis/build/ThoughtWorksInc/Binding.scala/)
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] sonatypeProfileName = com.thoughtworks.binding
[info] Reading staging profiles...
[info] Creating staging repository in profile: com.thoughtworks.binding
[error] org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".
[error] 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
[error] 	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1472)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
[error] 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
[error] 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
[error] 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
[error] 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[error] 	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[error] 	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[error] 	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
[error] 	at scala.xml.factory.XMLLoader.loadXML(XMLLoader.scala:41)
[error] 	at scala.xml.factory.XMLLoader.loadXML$(XMLLoader.scala:37)
[error] 	at scala.xml.XML$.loadXML(XML.scala:60)
[error] 	at scala.xml.factory.XMLLoader.load(XMLLoader.scala:53)
[error] 	at scala.xml.factory.XMLLoader.load$(XMLLoader.scala:53)
[error] 	at scala.xml.XML$.load(XML.scala:60)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.$anonfun$createStage$2(Sonatype.scala:727)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.$anonfun$createStage$2$adapted(Sonatype.scala:726)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.$anonfun$Post$1(Sonatype.scala:612)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.$anonfun$Post$1$adapted(Sonatype.scala:603)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.withHttpClient(Sonatype.scala:637)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.Post(Sonatype.scala:603)
[error] 	at xerial.sbt.Sonatype$NexusRESTService.createStage(Sonatype.scala:726)
[error] 	at xerial.sbt.Sonatype$SonatypeCommand$.$anonfun$sonatypeOpen$1(Sonatype.scala:216)
[error] 	at sbt.Command$.$anonfun$applyEffect$4(Command.scala:142)
[error] 	at sbt.Command$.$anonfun$applyEffect$2(Command.scala:137)
[error] 	at sbt.Command$.process(Command.scala:181)
[error] 	at sbt.MainLoop$.processCommand(MainLoop.scala:151)
[error] 	at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:139)
[error] 	at sbt.State$$anon$1.runCmd$1(State.scala:246)
[error] 	at sbt.State$$anon$1.process(State.scala:250)
[error] 	at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:139)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.MainLoop$.next(MainLoop.scala:139)
[error] 	at sbt.MainLoop$.run(MainLoop.scala:132)
[error] 	at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:110)
[error] 	at sbt.io.Using.apply(Using.scala:22)
[error] 	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:104)
[error] 	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:59)
[error] 	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:44)
[error] 	at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error] 	at sbt.StandardMain$.runManaged(Main.scala:138)
[error] 	at sbt.xMain.run(Main.scala:89)
[error] 	at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error] 	at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error] 	at xsbt.boot.Launch$.run(Launch.scala:109)
[error] 	at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error] 	at xsbt.boot.Launch$.launch(Launch.scala:117)
[error] 	at xsbt.boot.Launch$.apply(Launch.scala:18)
[error] 	at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error] 	at xsbt.boot.Boot$.main(Boot.scala:18)
[error] 	at xsbt.boot.Boot.main(Boot.scala)
[error] org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".
[error] Use 'last' for the full log.

https://travis-ci.org/ThoughtWorksInc/Binding.scala/jobs/512904034

sonatypeRelease fails

$ sbt +publishSigned
.... succeeds ....

I can see my published artifacts in the staging repository:

image

$ sbt +sonatypeRelease
[info] Loading project definition from /Users/jky/wrk/personal/pico-hashids/project
[info] Set current project to pico-hashids (in build file:/Users/jky/wrk/personal/pico-hashids/)
[info] Setting version to 2.10.6
[info] Reapplying settings...
[info] Set current project to pico-hashids (in build file:/Users/jky/wrk/personal/pico-hashids/)
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] sonatypeProfileName = org.picoworks
[info] Reading staging repository profiles...
[warn] No staging repository is found. Do publishSigned first.
java.lang.IllegalStateException: No staging repository is found. Run publishSigned first
	at xerial.sbt.Sonatype$NexusRESTService.findTargetRepository(Sonatype.scala:461)
	at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$19.apply(Sonatype.scala:205)
	at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$19.apply(Sonatype.scala:198)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$.process(Command.scala:93)
	at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
	at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
	at sbt.State$$anon$1.process(State.scala:184)
	at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
	at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.MainLoop$.next(MainLoop.scala:96)
	at sbt.MainLoop$.run(MainLoop.scala:89)
	at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
	at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
	at sbt.Using.apply(Using.scala:24)
	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
	at sbt.MainLoop$.runLogged(MainLoop.scala:22)
	at sbt.StandardMain$.runManaged(Main.scala:57)
	at sbt.xMain.run(Main.scala:29)
	at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
	at xsbt.boot.Launch$.run(Launch.scala:109)
	at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
	at xsbt.boot.Launch$.launch(Launch.scala:117)
	at xsbt.boot.Launch$.apply(Launch.scala:18)
	at xsbt.boot.Boot$.runImpl(Boot.scala:41)
	at xsbt.boot.Boot$.main(Boot.scala:17)
	at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.IllegalStateException: No staging repository is found. Run publishSigned first
[error] Use 'last' for the full log.

Is it possible to turn the commands into tasks?

I'm working on sbt-release-early: https://github.com/scalacenter/sbt-release-early.

It now has built-in support for sbt-bintray and sbt-sonatype. I'm doing some tricks to execute sonatype commands from tasks, and then ensuring that they are not run concurrently (especifically, sonatypeRelease).

However, I wonder, what's the need for commands? Wouldn't it be possible to have sbt-sonatype define tasks that can be executed concurrently? I believe that you may be relying on the sbt state to pass info from one command to the other one, and that may be the blocker. Have you thought about other alternatives?

Keeps trying to publish a module I have explicitly configured it not to

import ReleaseTransformations._

organization in ThisBuild := "ml.milkov"

lazy val core = project.in(file("core"))
  .settings(noPublishSettings)
  .settings(
    libraryDependencies ++= commonDeps
  )
  .settings(
    name := "mon-core"
  )

lazy val cloudwatch = project.in(file("cloudwatch"))
  .settings(releasePublishSettings)
  .settings(name := "mon-cloudwatch")
  .settings(
    libraryDependencies ++= commonDeps,
    libraryDependencies ++= Seq(
      "com.amazonaws.scala" % "aws-scala-sdk-cloudwatch" % "1.10.7"
    )
  )
  .configs(IntegrationTest.extend(Test))
  .settings(Defaults.itSettings: _*)
  .dependsOn(core % "compile->compile;test->test")

lazy val commonDeps = Seq(
  "com.typesafe.scala-logging" %% "scala-logging" % "3.5.0",
  "io.estatico" %% "newtype" % "0.1.0",
  "org.typelevel" %% "cats-core" % "1.0.1",
  "org.typelevel" %% "cats-effect" % "0.8",
  "org.typelevel" %% "mouse" % "0.16",

  "org.scalacheck" %% "scalacheck" % "1.13.4" % "test",
  "org.scalatest" %% "scalatest" % "3.0.1" % "test"
)

scalacOptions in Global ++= Seq(
  "-Xfatal-warnings",
  "-unchecked",
  "-feature",
  "-deprecation",
  "-language:higherKinds",
  "-language:implicitConversions"
)

lazy val noPublishSettings = Seq(
  publish := (),
  publishLocal := (),
  publishArtifact := false
)

lazy val releasePublishSettings = Seq(
  releaseCrossBuild := true,
  releasePublishArtifactsAction := PgpKeys.publishSigned.value,
  releaseProcess := Seq[ReleaseStep](
    checkSnapshotDependencies,
    inquireVersions,
    runClean,
    runTest,
    setReleaseVersion,
    commitReleaseVersion,
    tagRelease,
    publishArtifacts,
    setNextVersion,
    commitNextVersion,
    ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
    pushChanges
  ),
  homepage := Some(url("https://github.com/amilkov3/mon")),
  licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
  publishMavenStyle := true,
  publishArtifact in Test := false,
  pomIncludeRepository := { _ => false },
  sonatypeProfileName := "ml.milkov",
  publishTo := {
    val nexus = "https://oss.sonatype.org/"
    if (isSnapshot.value)
      Some("snapshots" at nexus + "content/repositories/snapshots")
    else
      Some("releases"  at nexus + "service/local/staging/deploy/maven2")
  },
  scmInfo := Some(
    ScmInfo(
      url("https://github.com/amilkov3/mon"),
      "https://github.com/amilkov3/mon.git"
    )
  ),
  developers := List(
    Developer("amilkov3",  "Alex Milkov", "[email protected]", url("http://milkov.ml"))
  )
)

what do i need to reconfigure so it stops trying to publish core?

sonatypeOpen doesn't have the effect it seems to have

The sonatypeOpen command does create a new staging repo, and it sets up state such that subsequent commands (notably, sonatypeRelease) will use that repo instead of the auto staged, but it does not modify publishTo! It actually has no effect on publication whatsoever, meaning that publish and publishSigned will always trigger autostaging, and if you have previously used sonatypeOpen, the sonatypeRelease command will be unable to reference the auto-staged repo (since it was overridden by the manually-opened one that was never used).

The solution here is to go back to defining publishTo in the sbt-sonatype plugin. What we did in sbt-slamdata should be relatively general:

publishTo := {
  val nexus = "https://oss.sonatype.org/"
  val profileM = sonatypeStagingRepositoryProfile.?.value

  if (isSnapshot.value) {
    Some("snapshots" at nexus + "content/repositories/snapshots")
  } else {
    val staged = profileM map { stagingRepoProfile =>
      "releases" at nexus +
      "service/local/staging/deployByRepositoryId/" +
      stagingRepoProfile.repositoryId
    }

    staged.orElse(Some("releases" at nexus + "service/local/staging/deploy/maven2"))
  }
}

Credit to @drostron on the above. With this definition of publishTo, all currently functional workflows will continue to work, and workflows involving sonatypeOpen will spring to life (whereas they currently do not work at all).

How to get repository id from publishSigned command

I want to release the staging repository that was created from running publishSigned, however sonatypeRelease will fail if there are more than one repository under the same staging profile. I don't want to release all the repositories, so sonatypeReleaseAll can't be used.

Poorly documented use of `sonatypePublishTo` with subprojects

Original issue

Use Case

Working on a project that has multiple subprojects and an empty root project used only for aggregation, I wanted to write a simple release procedure that would publish all of the subproject artifacts in one staging repository, and then release that repository. Because sonatypeRelease won't work when there are several staging repositories open, I opted for an "open, publish, release" flow.

Initial Attempt Based on Documentation

I had a simple script setup like this, called checkPublish to run after every build.

if [ $BRANCH == 'master' ]; then
    echo Publishing to Sonatype
    sbt 'sonatypeOpen "Release via Travis ($TRAVIS_BUILD_NUMBER)"' publishSigned sonatypeRelease
fi

In the settings shared by subprojects, I set publishTo := sonatypePublishTo.value, following the README to my best understanding.

Problem

However, this didn't work as expected. sonatypeOpen and sonatypeRelease did give normal looking logs, and publishSigned did run successfully, just nothing was released.

I ended up looking into the plugin's implementation for a while before I saw the cause of this problem.

The problem in this case is that sonatypeOpen and sonatypeRelease are implemented as commands, meaning they only change settings at the root level, and thus the value of sonatypePublishTo was only updated in the root project, which appears to do nothing in my use case.

Solution

In my top-level build.sbt, I set publishTo in ThisBuild := sonatypePublishTo.value, so that publishTo in subprojects inherits the value of sonatypePublishTo from the parent project.

Feedback / Recommendations

  • Since the README lists publishTo := sonatypePublishTo.value as a configuration, with no other commentary, it's not obvious that that configuration might not be correct in some cases. I would recommend adding some kind of qualification to the README so users know that this might be something to think about.

  • It was not obvious to me that the sbt-sonatype plugin could fail in this way, since sonatypeOpen could be implemented as a file-cached task or cached over subprojects using a scope filter.

  • To the prior point, I do concede that the documentation does state that sonatypeOpen, sonatypeClose, etc. are "commands". Still, I don't think many people are very acquainted with the distinction and consequences of using a command over a task.

Respect publishArtifact

Hi, I have an sbt project with subprojects, not all of which should be published. Sbt has a boolean setting "publishArtifact," but even when it's false it seems like sbt-sonatype tries to publish.

In fact, any project that doesn't have sonatypeSettings should perhaps be skipped rather than giving the error "Repository for publishing is not specified."

Thanks!

Always got "No staging repository is found. ..."

Step follow from README:

$ sbt publish-signed
...
[info] :: delivering :: com.ansvia.graph#blueprints-scala_2.10;0.1.17 :: 0.1.17 :: release :: Wed Aug 13 12:18:58 WIT 2014
...
Please enter PGP passphrase (or ENTER to abort): **************
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17.pom.asc
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17-javadoc.jar.asc
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17.jar.asc
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17-sources.jar
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17-javadoc.jar
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17-sources.jar.asc
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17.jar
[info]  published blueprints-scala_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/ansvia/graph/blueprints-scala_2.10/0.1.17/blueprints-scala_2.10-0.1.17.pom
[success] Total time: 146 s, completed Aug 13, 2014 12:21:24 PM

When trying to release:

$ sbt sonatypeRelease
...
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] Reading staging repository profiles...
java.lang.IllegalStateException: No staging repository is found. Run publish-signed first
    at xerial.sbt.Sonatype$NexusRESTService.findTargetRepository(Sonatype.scala:288)
    at xerial.sbt.Sonatype$$anonfun$sonatypeGlobalSettings$13$$anonfun$apply$17$$anonfun$apply$18.apply(Sonatype.scala:122)
    at xerial.sbt.Sonatype$$anonfun$sonatypeGlobalSettings$13$$anonfun$apply$17$$anonfun$apply$18.apply(Sonatype.scala:119)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
[error] (*:sonatypeRelease) java.lang.IllegalStateException: No staging repository is found. Run publish-signed first
[error] Total time: 6 s, completed Aug 13, 2014 12:24:09 PM

I'm using sbt 0.13.5 my plugins.sbt looks like:

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "0.2.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3")

Get the credentials from the existing settings

I already have credentials in my build.scala file for accessing Sonatype:

credentials := Seq(Credentials(Path.userHome / ".sbt" / "specs2.credentials"))

Is it possible to take these ones instead of requiring a file in ~/.sbt/<sbt-version>/sonatype.sbt? This is especially important for me because I publish different projects under different credentials to Sonatype. Thanks.

Found multiple staging repositories

I'd like to do this:

sbt +publishSigned sonatypeRelease

But I often run into issues because there are multiple staging repos (due to other releases going on). This also prevents me from using sonatypeReleaseAll. Is there any way for sonatypeRelease to know what staging repo was created by publishSigned and use that? Or maybe a new task that can publish and release?

[error] Unable to find credentials for [Sonatype Nexus Repository Manager @ oss.sonatype.org]

I've started to upgrade the sbt version and plugin versions for some of my projects, and sbt-sonatype 2.3 publishSigned is failing to authenticate against maven central. It's been a while since my last release, not sure what has changed.

slice of error output looks like:

[info] Packaging /home/eje/git/isarn-scalatest/target/scala-2.11/isarn-scalatest_2.11-0.0.3.jar ...
[info] Done packaging.
[error] Unable to find credentials for [Sonatype Nexus Repository Manager @ oss.sonatype.org].
[warn] CLIENT ERROR: 401 Unauthorized. Check your resolvers username and password.

My credentials file still looks like:

credentials += Credentials("Sonatype Nexus Repository Manager",
                           "oss.sonatype.org",
                           "my-user-name",
                           "my-password")

When I log into oss.sonatype.org manually, my username and password are still working.

I moved my gpg and sonatype specific config-files into ~/.sbt/1.0-pgp, and so I am using:

$ sbt -Dsbt.global.base=~/.sbt/1.0-pgp +publishSigned

as my publish command.

publishSigned succeeds but sonatypeRelease can't find the repository

publishSigned worked:

[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1-javadoc.jar.asc
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1.pom.asc
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1-sources.jar
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1.jar.asc
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1.jar
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1-sources.jar.asc
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1-javadoc.jar
[info] 	published ectrace_2.12 to https://oss.sonatype.org/ser
vice/local/staging/deploy/maven2/net/bzzt/ectrace_2.12/0.0.1/e
ctrace_2.12-0.0.1.pom

And indeed I see it in the staging repo:

oss.sonatype.info screenshot
]

But sonatypeRelease (nor sonatypeList) finds it:

[info] Set current project to ectrace (in build file:/home/aengelen/dev/ectrace/)
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] sonatypeProfileName = net.bzzt
[info] Reading staging repository profiles...
[warn] No staging repository is found. Do publishSigned first.
java.lang.IllegalStateException: No staging repository is found. Run publishSigned first
	at xerial.sbt.Sonatype$NexusRESTService.findTargetRepo
sitory(Sonatype.scala:461)

I'm probably doing something wrong myself (perhaps around the profileName?), but it's not very clear from the messages what piece I'm missing.

Cross-publish stages each Scala-version to a separate staging repository

When I cross-publish with '+publishSigned' the results are staged in multiple staging repositories (one for each Scala-version). Sometimes it is staged in a single repository. This seems ambiguous.
If I run 'sonatypeRelease' it fails when multi-repositories are found, but putting 'sonatypeReleaseAll' in my travis-build is not desired as there can be staging repositories (other builds, other projects).

I looked in the source code and tried some manual testing. It looks like 'sonatypeStagingRepositoryProfile' keeps a reference to a staging-repository. Is it possible to keep multiple references and have 'sonatypeRelease' promote and close this list of staging-repositories?

Retry on 500 error

We need to retry sonatypeRelease command on the following error:

[trace] Stack trace suppressed: run last *:sonatypeReleaseAll for the full output.
[error] (*:sonatypeReleaseAll) java.io.IOException: Failed to retrieve data from /staging/repository/orgxerial-1099/activity: HTTP/1.1 500 Server Error

why my groupid is default?

pomExtra := {
    <groupId>top.spoofer</groupId>
    <version>1.0</version>
}

i set the groupId like that, but the pom is:

<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <groupId>default</groupId> //------------------------------------------------------------+++
    <artifactId>jslog_2.10</artifactId>
    <packaging>jar</packaging>
    <description>jslog</description>
    <version>1.0</version>
    <name>jslog</name>
    <organization>
        <name>default</name>
    </organization>
    <groupId>top.spoofer</groupId> //------------------------------------------------------------+++
    <version>1.0</version>

java.lang.Exception: Failed to close the repository

╰─⠠⠵ sbt +publishSigned sonatypeReleaseAll
[info] Loading global plugins from /Users/pbhowmick/.sbt/0.13/plugins
[info] Loading project definition from /Users/pbhowmick/Projects/better-files/project
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[info] Set current project to root (in build file:/Users/pbhowmick/Projects/better-files/)
[info] Setting version to 2.10.6
[info] Reapplying settings...
[info] Set current project to root (in build file:/Users/pbhowmick/Projects/better-files/)
[info] Updating {file:/Users/pbhowmick/Projects/better-files/}core...
[info] Updating {file:/Users/pbhowmick/Projects/better-files/}root...
[info] Packaging /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/better-files-akka_2.10-2.15.0-sources.jar ...
[info] Packaging /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/better-files_2.10-2.15.0-sources.jar ...
[info] Done packaging.
[info] Done packaging.
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Updating {file:/Users/pbhowmick/Projects/better-files/}akka...
[info] Wrote /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/better-files_2.10-2.15.0.pom
[info] Resolving com.typesafe.akka#akka-actor_2.10;2.3.14 ...
[info] Main Scala API documentation to /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/api...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] :: delivering :: com.github.pathikrit#better-files_2.10;2.15.0 :: 2.15.0 :: release :: Wed Feb 10 20:07:06 PST 2016
[info]  delivering ivy file to /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/ivy-2.15.0.xml
[info] Wrote /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/better-files-akka_2.10-2.15.0.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Compiling 6 Scala sources to /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/classes...
[info] Done updating.
Waiting for lock on /Users/pbhowmick/.ivy2/.sbt.ivy.lock to be available...
[info] :: delivering :: com.github.pathikrit#better-files-akka_2.10;2.15.0 :: 2.15.0 :: release :: Wed Feb 10 20:07:06 PST 2016
[info]  delivering ivy file to /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/ivy-2.15.0.xml
Waiting for lock on /Users/pbhowmick/.ivy2/.sbt.ivy.lock to be available...
Waiting for lock on /Users/pbhowmick/.ivy2/.sbt.ivy.lock to be available...
[info] :: delivering :: com.github.pathikrit#root_2.10;2.15.0 :: 2.15.0 :: release :: Wed Feb 10 20:07:07 PST 2016
[info]  delivering ivy file to /Users/pbhowmick/Projects/better-files/target/scala-2.10/ivy-2.15.0.xml
Waiting for lock on /Users/pbhowmick/.ivy2/.sbt.ivy.lock to be available...
model contains 44 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/better-files_2.10-2.15.0-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/pbhowmick/Projects/better-files/core/target/scala-2.10/better-files_2.10-2.15.0.jar ...
[info] Main Scala API documentation to /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/api...
[info] Done packaging.
Please enter PGP passphrase (or ENTER to abort): *********
model contains 11 documentable templates
[info] Compiling 1 Scala source to /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/classes...
[info] Main Scala API documentation successful.
[info] Packaging /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/better-files-akka_2.10-2.15.0-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/pbhowmick/Projects/better-files/akka/target/scala-2.10/better-files-akka_2.10-2.15.0.jar ...
[info] Done packaging.
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0-javadoc.jar
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0-sources.jar.asc
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0-sources.jar
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0.pom
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0.jar.asc
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0.jar
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0-javadoc.jar.asc
[info]  published better-files_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.10/2.15.0/better-files_2.10-2.15.0.pom.asc
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0.pom
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0.jar.asc
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0.jar
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0-sources.jar
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0.pom.asc
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0-javadoc.jar
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0-javadoc.jar.asc
[info]  published better-files-akka_2.10 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.10/2.15.0/better-files-akka_2.10-2.15.0-sources.jar.asc
[success] Total time: 88 s, completed Feb 10, 2016 8:08:33 PM
[info] Setting version to 2.11.7
[info] Reapplying settings...
[info] Set current project to root (in build file:/Users/pbhowmick/Projects/better-files/)
[info] Packaging /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/better-files-akka_2.11-2.15.0-sources.jar ...
[info] Packaging /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/better-files_2.11-2.15.0-sources.jar ...
[info] Done packaging.
[info] Done packaging.
[info] Wrote /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/better-files_2.11-2.15.0.pom
[info] :: delivering :: com.github.pathikrit#root_2.11;2.15.0 :: 2.15.0 :: release :: Wed Feb 10 20:08:34 PST 2016
[info]  delivering ivy file to /Users/pbhowmick/Projects/better-files/target/scala-2.11/ivy-2.15.0.xml
[info] :: delivering :: com.github.pathikrit#better-files_2.11;2.15.0 :: 2.15.0 :: release :: Wed Feb 10 20:08:34 PST 2016
[info]  delivering ivy file to /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/ivy-2.15.0.xml
[info] Main Scala API documentation to /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/api...
[info] Wrote /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/better-files-akka_2.11-2.15.0.pom
[info] :: delivering :: com.github.pathikrit#better-files-akka_2.11;2.15.0 :: 2.15.0 :: release :: Wed Feb 10 20:08:34 PST 2016
[info]  delivering ivy file to /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/ivy-2.15.0.xml
[info] Compiling 2 Scala sources to /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/classes...
model contains 44 documentable templates
[info] Packaging /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/better-files_2.11-2.15.0.jar ...
[info] Main Scala API documentation to /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/api...
[info] Compiling 1 Scala source to /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/classes...
[info] Done packaging.
model contains 11 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/better-files-akka_2.11-2.15.0-javadoc.jar ...
[info] Done packaging.
[info] Main Scala API documentation successful.
[info] Packaging /Users/pbhowmick/Projects/better-files/core/target/scala-2.11/better-files_2.11-2.15.0-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/pbhowmick/Projects/better-files/akka/target/scala-2.11/better-files-akka_2.11-2.15.0.jar ...
[info] Done packaging.
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0.pom
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0.jar.asc
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0.jar
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0-sources.jar
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0.pom.asc
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0-javadoc.jar
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0-javadoc.jar.asc
[info]  published better-files-akka_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files-akka_2.11/2.15.0/better-files-akka_2.11-2.15.0-sources.jar.asc
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0-javadoc.jar
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0-sources.jar.asc
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0-sources.jar
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0.pom
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0.jar.asc
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0.jar
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0-javadoc.jar.asc
[info]  published better-files_2.11 to https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/pathikrit/better-files_2.11/2.15.0/better-files_2.11-2.15.0.pom.asc
[success] Total time: 30 s, completed Feb 10, 2016 8:09:04 PM
[info] Setting version to 2.11.7
[info] Reapplying settings...
[info] Set current project to root (in build file:/Users/pbhowmick/Projects/better-files/)
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] sonatypeProfileName = com.github.pathikrit
[info] Reading staging repository profiles...
[info] Reading staging profiles...
[info] Closing staging repository [comgithubpathikrit-1013] status:open, profile:com.github.pathikrit(3ce6558c41fb47)
[info] Activity open started:2016-01-18T20:06:59.758Z, stopped:2016-01-18T20:07:02.358Z
[info] repositoryCreated: id:comgithubpathikrit-1013, user:pathikrit, ip:54.80.189.227
[info] Activity close started:2016-01-31T00:22:14.271Z, stopped:2016-01-31T00:22:19.376Z
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Missing Signature: '/com/github/pathikrit/better-files-akka_2.10/2.14.0/better-files-akka_2.10-2.14.0-javadoc.jar.asc' does not exist for 'better-files-akka_2.10-2.14.0-javadoc.jar'.
[info]   Evaluate: pom-staging
[info]     Passed: pom-staging
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]     Failed: id:5e9e8e6f8d20a3, failureCount:1
[info] repositoryCloseFailed: id:comgithubpathikrit-1013, cause:com.sonatype.nexus.staging.StagingRulesFailedException: One or more rules have failed
[info] Activity close started:2016-01-31T08:41:59.447Z, stopped:2016-01-31T08:42:08.624Z
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: pom-staging
[info]     Passed: pom-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Missing Signature: '/com/github/pathikrit/better-files-akka_2.10/2.14.0/better-files-akka_2.10-2.14.0-javadoc.jar.asc' does not exist for 'better-files-akka_2.10-2.14.0-javadoc.jar'.
[info]     Failed: id:5e9e8e6f8d20a3, failureCount:1
[info] repositoryCloseFailed: id:comgithubpathikrit-1013, cause:com.sonatype.nexus.staging.StagingRulesFailedException: One or more rules have failed
[info] Activity close started:2016-02-11T04:09:13.534Z, stopped:
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Missing Signature: '/com/github/pathikrit/better-files-akka_2.10/2.14.0/better-files-akka_2.10-2.14.0-javadoc.jar.asc' does not exist for 'better-files-akka_2.10-2.14.0-javadoc.jar'.
[info]   Evaluate: pom-staging
[error] Failed to close the repository
[error] Activity close started:2016-02-11T04:09:13.534Z, stopped:
[error]     Failed: signature-staging, failureMessage:Missing Signature: '/com/github/pathikrit/better-files-akka_2.10/2.14.0/better-files-akka_2.10-2.14.0-javadoc.jar.asc' does not exist for 'better-files-akka_2.10-2.14.0-javadoc.jar'.
java.lang.Exception: Failed to close the repository
        at xerial.sbt.Sonatype$NexusRESTService.closeStage(Sonatype.scala:599)
        at xerial.sbt.Sonatype$NexusRESTService.closeAndPromote(Sonatype.scala:693)
        at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$6$$anonfun$7.apply(Sonatype.scala:147)
        at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$6$$anonfun$7.apply(Sonatype.scala:146)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$6.apply(Sonatype.scala:146)
        at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$6.apply(Sonatype.scala:144)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$.process(Command.scala:93)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:98)
        at sbt.State$$anon$1.process(State.scala:184)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:98)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.MainLoop$.next(MainLoop.scala:98)
        at sbt.MainLoop$.run(MainLoop.scala:91)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:70)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:65)
        at sbt.Using.apply(Using.scala:24)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:65)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:48)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:32)
        at sbt.MainLoop$.runLogged(MainLoop.scala:24)
        at sbt.StandardMain$.runManaged(Main.scala:53)
        at sbt.xMain.run(Main.scala:28)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:109)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
        at xsbt.boot.Launch$.launch(Launch.scala:117)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:41)
        at xsbt.boot.Boot$.main(Boot.scala:17)
        at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.Exception: Failed to close the repository
[error] Use 'last' for the full log.

Useless error message for multiple repos

I tried to release my project:

> sbt ++2.11.12 sonatypeRelease

[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /Users/pbhowmick/workspace/better-files/project
[info] Loading settings from version.sbt,build.sbt ...
[info] Set current project to better-files-root (in build file:/Users/pbhowmick/workspace/better-files/)
[info] Setting Scala version to 2.11.12 on 3 projects.
[info] Reapplying settings...
[info] Set current project to better-files-root (in build file:/Users/pbhowmick/workspace/better-files/)
[info] Nexus repository URL: https://oss.sonatype.org/service/local
[info] sonatypeProfileName = com.github.pathikrit
[info] Reading staging repository profiles...
[error] Multiple repositories are found:
[error] [comgithubpathikrit-1045] status:open, profile:com.github.pathikrit(3ce6558c41fb47) description: Implicitly created (auto staging).
[error] [comgithubpathikrit-1046] status:open, profile:com.github.pathikrit(3ce6558c41fb47) description: Implicitly created (auto staging).
[error] Specify one of the repository ids in the command line
[error] java.lang.IllegalStateException: Found multiple staging repositories
[error]         at xerial.sbt.Sonatype$NexusRESTService.$anonfun$findTargetRepository$8(Sonatype.scala:532)
[error]         at scala.Option.getOrElse(Option.scala:121)
[error]         at xerial.sbt.Sonatype$NexusRESTService.findTargetRepository(Sonatype.scala:529)
[error]         at xerial.sbt.Sonatype$SonatypeCommand$.$anonfun$sonatypeRelease$1(Sonatype.scala:269)
[error]         at sbt.Command$.$anonfun$applyEffect$4(Command.scala:134)
[error]         at sbt.Command$.$anonfun$applyEffect$2(Command.scala:130)
[error]         at sbt.MainLoop$.processCommand(MainLoop.scala:154)
[error]         at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:137)
[error]         at sbt.State$$anon$1.runCmd$1(State.scala:242)
[error]         at sbt.State$$anon$1.process(State.scala:248)
[error]         at sbt.MainLoop$.$anonfun$next$1(MainLoop.scala:137)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.MainLoop$.next(MainLoop.scala:137)
[error]         at sbt.MainLoop$.run(MainLoop.scala:130)
[error]         at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:108)
[error]         at sbt.io.Using.apply(Using.scala:22)
[error]         at sbt.MainLoop$.runWithNewLog(MainLoop.scala:102)
[error]         at sbt.MainLoop$.runAndClearLast(MainLoop.scala:58)
[error]         at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:43)
[error]         at sbt.MainLoop$.runLogged(MainLoop.scala:35)
[error]         at sbt.StandardMain$.runManaged(Main.scala:113)
[error]         at sbt.xMain.run(Main.scala:76)
[error]         at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
[error]         at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
[error]         at xsbt.boot.Launch$.run(Launch.scala:109)
[error]         at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
[error]         at xsbt.boot.Launch$.launch(Launch.scala:117)
[error]         at xsbt.boot.Launch$.apply(Launch.scala:18)
[error]         at xsbt.boot.Boot$.runImpl(Boot.scala:56)
[error]         at xsbt.boot.Boot$.main(Boot.scala:18)
[error]         at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.IllegalStateException: Found multiple staging repositories

This line is unhelpful: Specify one of the repository ids in the command line. What incantation do I need to run now? An example would be helpful? What is a repository id? How do I find it??

Intermittent invalid generated signatures

I'm using sbt-pgp together with sbt-sonatype and sbt-release (see release settings) to cross-build to Scala and Scala.js on 2.10, 2.11, and 2.12. Typically, everything goes fine until it's time to close the staging repository, when Sonatype complains that some artifacts (from what I've been able to see, it's usually different ones every time) have invalid signatures.

[info] Closing staging repository [iscir-1012] status:open, profile:is.cir(60b94b73626074) description: Implicitly created (auto staging).
[info] Activity open started:2017-05-25T21:49:47.982Z, stopped:2017-05-25T21:49:52.357Z
[info] repositoryCreated: id:iscir-1012, user:vlovgr
[info] Activity close started:2017-05-25T21:54:54.041Z, stopped:2017-05-25T21:55:17.322Z
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Invalid Signature: '/is/cir/ciris-enumeratum_2.11/0.3.1/ciris-enumeratum_2.11-0.3.1.jar.asc' is not a valid signature for 'ciris-enumeratum_2.11-0.3.1.jar'.
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: pom-staging
[info]     Passed: pom-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]     Failed: id:5e9e8e6f8d20a3, failureCount:1
[info] repositoryCloseFailed: id:iscir-1012, cause:com.sonatype.nexus.staging.StagingRulesFailedException: One or more rules have failed
[info] Activity close started:2017-05-25T22:11:15.116Z, stopped:2017-05-25T22:11:29.844Z
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: pom-staging
[info]     Passed: pom-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Invalid Signature: '/is/cir/ciris-enumeratum_2.10/0.3.1/ciris-enumeratum_2.10-0.3.1-javadoc.jar.asc' is not a valid signature for 'ciris-enumeratum_2.10-0.3.1-javadoc.jar'.
[info]     Failed: id:5e9e8e6f8d20a3, failureCount:1
[info] repositoryCloseFailed: id:iscir-1012, cause:com.sonatype.nexus.staging.StagingRulesFailedException: One or more rules have failed
[info] Activity close started:2017-05-25T22:21:08.093Z, stopped:2017-05-25T22:21:31.755Z
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Invalid Signature: '/is/cir/ciris-core_2.12/0.3.1/ciris-core_2.12-0.3.1.jar.asc' is not a valid signature for 'ciris-core_2.12-0.3.1.jar'.
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: pom-staging
[info]     Passed: pom-staging
[info]     Failed: id:5e9e8e6f8d20a3, failureCount:1
[info] repositoryCloseFailed: id:iscir-1012, cause:com.sonatype.nexus.staging.StagingRulesFailedException: One or more rules have failed
[info] Activity close started:2017-05-25T22:31:35.700Z, stopped:2017-05-25T22:31:52.635Z
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: pom-staging
[info]     Passed: pom-staging
[info]   Evaluate: checksum-staging
[info]     Passed: checksum-staging
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Invalid Signature: '/is/cir/ciris-squants_sjs0.6_2.11/0.3.1/ciris-squants_sjs0.6_2.11-0.3.1-javadoc.jar.asc' is not a valid signature for 'ciris-squants_sjs0.6_2.11-0.3.1-javadoc.jar'.
[info]     Failed: id:5e9e8e6f8d20a3, failureCount:1
[info] repositoryCloseFailed: id:iscir-1012, cause:com.sonatype.nexus.staging.StagingRulesFailedException: One or more rules have failed
[info] Activity close started:2017-05-25T23:12:13.660Z, stopped:
[info]   Evaluate: id:5e9e8e6f8d20a3, rule:sources-staging
[info]   Evaluate: signature-staging
[info]     Failed: signature-staging, failureMessage:Invalid Signature: '/is/cir/ciris-generic_2.11/0.3.1/ciris-generic_2.11-0.3.1-sources.jar.asc' is not a valid signature for 'ciris-generic_2.11-0.3.1-sources.jar'.
[info]   Evaluate: sources-staging
[info]     Passed: sources-staging
[info]   Evaluate: javadoc-staging
[info]     Passed: javadoc-staging
[info]   Evaluate: checksum-staging
[error] Failed to close the repository
[error] Activity close started:2017-05-25T23:12:13.660Z, stopped:
[error]     Failed: signature-staging, failureMessage:Invalid Signature: '/is/cir/ciris-generic_2.11/0.3.1/ciris-generic_2.11-0.3.1-sources.jar.asc' is not a valid signature for 'ciris-generic_2.11-0.3.1-sources.jar'.
java.lang.Exception: Failed to close the repository
	at xerial.sbt.Sonatype$NexusRESTService.closeStage(Sonatype.scala:717)
	at xerial.sbt.Sonatype$NexusRESTService.closeAndPromote(Sonatype.scala:816)
	at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$19.apply(Sonatype.scala:206)
	at xerial.sbt.Sonatype$SonatypeCommand$$anonfun$19.apply(Sonatype.scala:198)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbtrelease.ReleasePlugin$autoImport$$anonfun$releaseStepCommand$2.apply(ReleasePlugin.scala:94)
	at sbtrelease.ReleasePlugin$autoImport$$anonfun$releaseStepCommand$2.apply(ReleasePlugin.scala:92)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$$anonfun$5.sbtrelease$ReleasePlugin$autoImport$ReleaseKeys$$anonfun$$filterFailure$1(ReleasePlugin.scala:175)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$$anonfun$5$$anonfun$8$$anonfun$apply$3.apply(ReleasePlugin.scala:189)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$$anonfun$5$$anonfun$8$$anonfun$apply$3.apply(ReleasePlugin.scala:189)
	at scala.Function$$anonfun$chain$1$$anonfun$apply$1.apply(Function.scala:24)
	at scala.Function$$anonfun$chain$1$$anonfun$apply$1.apply(Function.scala:24)
	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
	at scala.collection.immutable.List.foldLeft(List.scala:84)
	at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:138)
	at scala.collection.AbstractTraversable.$div$colon(Traversable.scala:105)
	at scala.Function$$anonfun$chain$1.apply(Function.scala:24)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$$anonfun$5.apply(ReleasePlugin.scala:193)
	at sbtrelease.ReleasePlugin$autoImport$ReleaseKeys$$anonfun$5.apply(ReleasePlugin.scala:156)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
	at sbt.Command$.process(Command.scala:93)
	at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
	at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
	at sbt.State$$anon$1.doX$1(State.scala:183)
	at sbt.State$$anon$1.process(State.scala:190)
	at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
	at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.MainLoop$.next(MainLoop.scala:96)
	at sbt.MainLoop$.run(MainLoop.scala:89)
	at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
	at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
	at sbt.Using.apply(Using.scala:24)
	at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
	at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
	at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
	at sbt.MainLoop$.runLogged(MainLoop.scala:22)
	at sbt.StandardMain$.runManaged(Main.scala:109)
	at sbt.xMain.run(Main.scala:38)
	at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
	at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
	at xsbt.boot.Launch$.run(Launch.scala:109)
	at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
	at xsbt.boot.Launch$.launch(Launch.scala:117)
	at xsbt.boot.Launch$.apply(Launch.scala:18)
	at xsbt.boot.Boot$.runImpl(Boot.scala:41)
	at xsbt.boot.Boot$.main(Boot.scala:17)
	at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.Exception: Failed to close the repository

When this happens, I've manually tried to verify the local signatures of the failing artifacts with gpg --verify and it tells me that, indeed, the signatures are invalid. If repeating the release process from the beginning, after a few tries (sometimes up to 10 retries), it normally works just fine, and I'm able to close the staging repository successfully, without having to change anything.

secret key ring doesn't start with secret key tag

Hello,

I am running into this error whenever I attempt to use publishSigned.

(*:signedArtifacts) java.io.IOException: secret key ring doesn't start with secret key tag: tag 0xffffffff

The weird thing is that this error is random. For example, whenever I run sbt package before running publishSigned, I run into this error.

pom file created in staging is stripped of <developers> entry, cause unknown

I am trying to publish to our com.bazaarvoice repository using the sbt plugin and I discovered that when I do a publishLocalSigned the pom files produced are correct but when I do a publishSigned the pom does not include the entry up in staging and as a result the changes cannot be promoted. Can anyone help me with this, I cannot see what would cause such bizarre behavior. I am attaching all of my scala project files related to the use of the plugin, as well as a copy of one of our poms that I get when I do a publishLocalSigned. The locally published pom is right but the one currently up in our staging directory is missing the entry for some reason.
sonatype.sbt.txt
plugins.sbt.txt
Commons.scala.txt
publishSigned-sswf-example_2.10.pom.txt
publishLocalSigned-sswf-example_2.10.pom.txt

Invalide dependecies

At time, with just add the sbt plugin, I receive:

[warn] Note: Unresolved dependencies path:
[warn] org.apache.httpcomponents:httpclient:4.2.6
[warn] +- org.xerial.sbt:sbt-sonatype:1.1 (scalaVersion=2.10, sbtVersion=0.13) [warn] +- default:generator-build:0.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: org.apache.httpcomponents#httpclient;4.2.6: not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.