ennru / sbt-bill-of-materials

Create 'Bill of Materials' (BOM) POM files from sbt for consumption in Maven and Gradle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sbt-bill-of-materials bintray-badge

A sbt plugin to generate Bill of Materials (BOM) pom.xml for use with Maven or Gradle.

A BOM for a Scala project may either

  1. reference a single Scala minor version and create a BOM POM per Scala minor version, or choose to
  2. list all its artifacts for their Scala versions in a single BOM POM.

Artifacts that typically appear as libraries should use 1. to ensure dependencies do not mix Scala minor versions.

For frameworks which give the user a pre-defined set of dependencies approach 2. may appear simpler. Lagom has been using approach 2. for many years.

Usage

Add the sbt plug-in in project/plugins.sbt

addSbtPlugin("com.lightbend.sbt" % "sbt-bill-of-materials" % <latest>)

Create a BOM per Scala minor version

Create an sbt (sub-)project which will produce the BOM. list the sbt projects to include in the BOM as bomIncludeProjects.

lazy val billOfMaterials = project
  .enablePlugins(BillOfMaterialsPlugin)
  .settings(
    name := "sample-library-bom",
    bomIncludeProjects := Seq(core, nonScala)
  )

Create the BOM pom.xml files with:

sbt +billOfMaterials/publishM2

Create a single BOM for all Scala versions

lazy val billOfMaterials = project
  .enablePlugins(BillOfMaterialsPlugin)
  .settings(
    name := "framework-sample-bom",
    // Just one BOM including all cross Scala versions
    crossVersion := CrossVersion.disabled,
    // Create BOM in the first runn
    crossScalaVersions := crossScalaVersions.value.take(1),
    bomIncludeProjects := Seq(core),
  )

Create the BOM pom.xml files with:

sbt billOfMaterials/publishM2

License

The license is Apache 2.0, see LICENSE.

Maintenance notes

The Akka team created this plugin to create Maven BOM POMs for parts of the Akka toolkit.

This project is community-maintained. Pull requests are very welcome –- thanks in advance!

Lightbend does not offer support for this project.

About

Create 'Bill of Materials' (BOM) POM files from sbt for consumption in Maven and Gradle.

License:Apache License 2.0


Languages

Language:Scala 100.0%