Skip to content

Commit

Permalink
Document that license is a required setting
Browse files Browse the repository at this point in the history
We had a failed release on https://github.com/guardian/targeting-client after
guardian/targeting-client#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 sbt/librarymanagement#395)
supply a `License` object that means you can define the license much more concisely:

```
licenses := Seq(License.Apache2)
```

Used successfully in guardian/etag-caching#29
  • Loading branch information
rtyley committed Dec 22, 2023
1 parent c6b834a commit c5899f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5899f7

Please sign in to comment.