Repository navigation
feat(build): publish a java-spiffe-bom Bill of Materials - #506
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
Consumers of java-spiffe have to keep the versions of several io.spiffe
artifacts in sync by hand: java-spiffe-core, java-spiffe-provider and
java-spiffe-helper, plus the platform-specific grpc-netty-linux,
grpc-netty-macos and grpc-netty-macos-aarch64 runtime modules, whose
version must match the one of java-spiffe-core. Nothing in the build
helps them, and a stale macOS transport module next to a newer core is
easy to miss.
Add a java-spiffe-bom subproject built with the java-platform plugin.
It declares a version constraint on every other subproject, so all of
them are covered automatically, including modules added later. It is
published with the existing vanniktech configuration and appears in
Maven as a pom-packaged artifact with a dependencyManagement section
(for import scope) and in Gradle Module Metadata as a platform:
implementation platform('io.spiffe:java-spiffe-bom:<version>')
implementation 'io.spiffe:java-spiffe-provider'
The root build applied java-library, jacoco and the Java conventions to
every subproject, which is incompatible with java-platform. Split the
subprojects block: group, version, the shared ext versions and the
Maven Central publishing configuration still apply to all subprojects,
while the Java library conventions apply to libraryProjects, every
subproject except the BOM. The aggregate jacocoTestReport now iterates
libraryProjects as well, since the BOM has no test task or source sets.
The generated POMs and Gradle module metadata of the existing modules
are unchanged.
Document the BOM in the README and add a changelog entry.
Refs spiffe#106
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
java-spiffe-bommodule, a Bill of Materials published to Maven Central next to the other artifacts. It manages the version of every java-spiffe module:java-spiffe-core,java-spiffe-provider,java-spiffe-helper,grpc-netty-linux,grpc-netty-macosandgrpc-netty-macos-aarch64.Maven:
Gradle:
java-spiffe-bom/build.gradleappliesjava-platformand adds a constraint for every other subproject, so a module added later is covered without editing the BOM.subprojectsblock is split. Group, version, the sharedextversions and the Maven Central publishing and signing configuration still apply to every subproject, including the BOM.java-library,jacocoand the Java conventions now apply tolibraryProjects, all subprojects except the BOM, becausejava-platformcan't be combined withjava-library. The aggregatejacocoTestReportiterateslibraryProjectstoo, since the BOM has no test task or source sets.Addedentry. The README snippets use the same version as the rest of the README, so they get bumped with the release like the others.Refs #106. It covers the last part of that issue, a BOM for the java-spiffe modules themselves. Using the gRPC and Netty BOMs inside the build is a separate change.
Why
Users currently have to keep up to six
io.spiffeversions in sync by hand. That's easy to get wrong for the platform-specificgrpc-netty-*runtime modules: they are added separately fromjava-spiffe-core(often conditionally, per OS) and have to match its version, because they provide theio.spiffe.workloadapi.internalclasses that core loads. With the BOM, they declare one version and the build keeps everything aligned.Compatibility: this only adds an artifact. The generated
pom-default.xmlandmodule.jsonof all existing modules are byte-identical to the onesmaingenerates. The BOM is published as a signedpom-packaged artifact with adependencyManagementsection, plus Gradle Module Metadata with theplatformcategory.japicmpcovers only core and provider and isn't affected.How tested
mainand on this branch and diffed them. The existing modules are identical, and the BOM's POM and module metadata list all six modules at the project version.platform('io.spiffe:java-spiffe-bom:0.8.17'),java-spiffe-providerandgrpc-netty-macos-aarch64with no versions. Everyio.spiffemodule resolved to 0.8.17../gradlew clean buildand./gradlew test jacocoTestReport(the coverage workflow) on JDK 17.