Excluding a project from an sbt multi project from a publication (sbt-gpg)

The latest version 0.8 sbt-pgp plugin introduces a new task publish-signedfor pushing products, for example, into the OAT Sonatype repository.

Now I had a multiproject with an aggregate that should not have been published:

lazy val root: Project = Project(
  id        = "root",
  base      = file("."),
  aggregate = Seq(foo, bar, baz),
  settings  = Project.defaultSettings ++ Seq(
    publishLocal  := (),
    publish       := ()
  )
)

Now publish := ()ignored when used publish-signed. I have already added:

import com.typesafe.sbt.pgp.PgpKeys._
publishSigned := ()

This does not work, the plugin still publishes an aggregate leading to a failure by Sonatype (since it is empty, does not have license information, etc.)

How to exclude project publication using publish-signed?

+2
source share
1 answer

The following works:

lazy val root: Project = Project(
  id        = "root",
  base      = file("."),
  aggregate = Seq(foo, bar, baz),
  settings  = Project.defaultSettings ++ Seq(
    packagedArtifacts := Map.empty           // prevent publishing anything!
  )
)
+4
source

Source: https://habr.com/ru/post/1525033/


All Articles