Skip to content

fix: update maven boms and skip the artifacts they version - #477

Merged
krakeusz merged 1 commit into
VirtusLab:mainfrom
dhalperi:fix-maven-bom-updates
Sep 24, 2026
Merged

krakeusz merged 1 commit into
VirtusLab:mainfrom
dhalperi:fix-maven-bom-updates

Conversation

@dhalperi

@dhalperi dhalperi commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

rules_jvm_external writes three files for @maven//:outdated --
outdated.repositories, outdated.artifacts and outdated.boms -- but
MavenDataExtractor only read the first two, so no bom was ever a
candidate for a bump.

Worse, declaring a bom is what strips versions off the artifacts it
manages, and those still appear in outdated.artifacts as
"group:artifact:" with an empty version. Those parsed into a
SimpleVersion(""), which toSemVer rejects, so UpdateLogic silently
dropped them. A repository that moves a family of artifacts under a bom
therefore stops getting updates for the bom and for every artifact the
bom versions.

Read outdated.boms as well, treating it as optional since it is absent
before rules_jvm_external 6.x, and filter versionless artifacts out
explicitly at parse time rather than relying on a null from toSemVer
several layers down. Bumping the bom is what moves the artifacts it
manages; they have no version text of their own to rewrite.

The e2e fixture pins rules_jvm_external 6.10 for boms support; the
existing 5.2 fixtures cover the absent-outdated.boms path.

@dhalperi
dhalperi force-pushed the fix-maven-bom-updates branch from 9db77dc to ecf71eb Compare July 27, 2026 10:33

@krakeusz krakeusz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment. Other than that, thank you for the contrubution!

}

@Test
fun `should keep the classifier out of the version`() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format seems to be group:artifact:version, so it seems you have provided no classifier in the test.
Could you rename the test? Or did you intend to test a group:artifact:packaging:classifier:version case?

@dhalperi dhalperi Aug 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, no classifier there. coursier.bzl writes outdated.artifacts as group:artifact:version and strips the classifier first, so no 5-part case reaches this code.

I deleted the test instead of renaming it -- without the classifier its input was the same as should parse coordinates above it.

rules_jvm_external writes three files for @maven//:outdated --
outdated.repositories, outdated.artifacts and outdated.boms -- but
MavenDataExtractor only read the first two, so no bom was ever a
candidate for a bump.

Worse, declaring a bom is what strips versions off the artifacts it
manages, and those still appear in outdated.artifacts as
"group:artifact:" with an empty version. Those parsed into a
SimpleVersion(""), which toSemVer rejects, so UpdateLogic silently
dropped them. A repository that moves a family of artifacts under a bom
therefore stops getting updates for the bom and for every artifact the
bom versions.

Read outdated.boms as well, treating it as optional since it is absent
before rules_jvm_external 6.x, and filter versionless artifacts out
explicitly at parse time rather than relying on a null from toSemVer
several layers down. Bumping the bom is what moves the artifacts it
manages; they have no version text of their own to rewrite.

The e2e fixture pins rules_jvm_external 6.10 for boms support; the
existing 5.2 fixtures cover the absent-outdated.boms path.
@dhalperi
dhalperi force-pushed the fix-maven-bom-updates branch from ecf71eb to 49262b9 Compare August 18, 2026 06:08
@krakeusz
krakeusz merged commit 21a745e into VirtusLab:main Sep 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants