Skip to main content

Publishing Settings

Configure your project for publishing to Maven Central using sbt-ci-release.

Prerequisites

The publishing settings require the sbt-ci-release plugin. Add it to your project/plugins.sbt:

addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "VERSION")

This plugin handles:

  • Automated versioning from git tags
  • GPG signing
  • Publishing to Sonatype/Maven Central
  • GitHub Actions integration

See the sbt-ci-release documentation for setup instructions.

Configuration

Add the following to your build.conf:

homepage = "https://github.com/your-org/your-project"

licenses = ["MIT"]

versionScheme = "early-semver"

developers = [
{
id = "johndoe"
name = "John Doe"
email = "john@example.com"
url = "https://johndoe.dev"
}
]

Supported Licenses

The following license identifiers are supported, matching sbt.librarymanagement.License:

IdentifierLicense
Apache2Apache License 2.0
MITMIT License
CC0Creative Commons Zero
GPL3GNU General Public License v3.0

Version Schemes

Valid values for versionScheme:

ValueDescription
early-semverSemVer with early compatibility (recommended for Scala)
semver-specStrict SemVer
pvpPackage Versioning Policy (Haskell-style)
alwaysAlways compatible
strictStrict versioning

Developer Format

Each developer entry requires all four fields:

FieldDescription
idDeveloper ID (e.g., GitHub username)
nameFull name
emailEmail address
urlPersonal/professional URL

Multiple developers can be specified:

developers = [
{
id = "dev1"
name = "Developer One"
email = "dev1@example.com"
url = "https://dev1.example.com"
},
{
id = "dev2"
name = "Developer Two"
email = "dev2@example.com"
url = "https://dev2.example.com"
}
]

Complete Example

A full build.conf with publishing settings:

name = "my-library"
organization = "com.example"
scalaVersion = "3.3.4"

dependencies = [
"org.typelevel:cats-core:2.13.0"
]

testDependencies = [
"org.scalatest:scalatest:3.2.19"
]

# Publishing (requires sbt-ci-release)
homepage = "https://github.com/example/my-library"
licenses = ["Apache2"]
versionScheme = "early-semver"
developers = [
{
id = "maintainer"
name = "Project Maintainer"
email = "maintainer@example.com"
url = "https://example.com"
}
]