From 4da7d4d8e997b28f22b103eb08d0707e2902ccf9 Mon Sep 17 00:00:00 2001 From: Roberto Tyley Date: Fri, 22 Dec 2023 16:20:33 +0000 Subject: [PATCH] Document that `license` is a required setting We had a failed release on https://github.com/guardian/targeting-client after https://github.com/guardian/targeting-client/pull/37 accidentally removed the `license` setting: https://github.com/guardian/targeting-client/actions/runs/7299896704/job/19893644176#step:5:56 ``` 2023-12-22 12:37:31.245Z error [SonatypeClient] [close] Failed - (SonatypeClient.scala:181) 2023-12-22 12:37:31.245Z error [SonatypeClient] Activity name:close, started:2023-12-22T12:36:34.296Z - (SonatypeClient.scala:469) 2023-12-22 12:37:31.246Z error [SonatypeClient] Failed: pom-staging, failureMessage:Invalid POM: /com/gu/targeting-client/client-play-json-v30_2.13/1.1.5/client-play-json-v30_2.13-1.1.5.pom: License information missing - (SonatypeClient.scala:387) ``` Specifying a license is *required* for submitting a project to Maven Central: https://central.sonatype.org/publish/requirements/#license-information Note that sbt v1.6.2 and above (thanks to https://github.com/sbt/librarymanagement/pull/395) supply a `License` object that means you can define the license much more concisely: ``` licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")) ``` Used successfully in https://github.com/guardian/etag-caching/pull/29 --- docs/configuration.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 91f9fa7..7ffce43 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -54,6 +54,9 @@ to the workflow. suffix. You can think of `-SNAPSHOT` as meaning 'a snapshot preview' - so when you're working on `1.4.7-SNAPSHOT`, you're working on a _preview_ of the forthcoming `1.4.7` release. The workflow will automatically update the `version` during each release, as appropriate. +* `licenses := Seq(License.Apache2)` - or whatever license you're using. Specifying a license is + [*required*](https://central.sonatype.org/publish/requirements/#license-information) for submitting artifacts + to Maven Central. * `releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value` - to activate the automatic compatibility-based version-numbering provided by the `sbt-version-policy` plugin. This means your `version` can go up by more than just an `x.x.PATCH` increment in a release, if