Skip to content

Support for Bill Of Materials #59

@afloarea

Description

@afloarea

Summary

Maven supports the idea of a Bill of Materials (BOMs) that hold versions for dependencies.

For example:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-stack-depchain</artifactId>
                <version>${vertx.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

Then dependencies can be declared without version:

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
        </dependency>

        <dependency> <!--Optional dependency of vertx-core-->
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

This allows for upgrading the dependencies in the BOM all at once with a single version change of the BOM.

Proposal

Add support for BOMs in bld

For example:

public class BldProjectBuild extends Project {
    public BldProjectBuild() {
        pkg = "com.example";
        name = "example";
        mainClass = "com.example.Main";
        version = version(0, 1, 0);
        javaRelease = 21;

        repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);

        BillOfMaterials bom = BillOfMaterials.of("io.vertx", "vertx-stack-depchain", version(4, 5, 12));

        scope(compile)
                .include(dependency("io.vertx", "vertx-core", bom))
                .include(dependency("com.fasterxml.jackson.core", "jackson-databind", bom));
    }

    public static void main(String[] args) {
        new BldProjectBuild().start(args);
    }
}

Of course, this is just an example, maybe there is better syntax for this or maybe there is a better approach altogether. Please let me know what you think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions