Skip to content

[Backport maven-4.0.x] mvnup: upgrade BND plugins to fix ConcurrentModificationException on JDK 17.0.13+ - #13021

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/13001-mvnup-bnd-plugin-upgrade
Sep 2, 2026
Merged

[Backport maven-4.0.x] mvnup: upgrade BND plugins to fix ConcurrentModificationException on JDK 17.0.13+#13021
gnodet merged 1 commit into
maven-4.0.xfrom
backport/13001-mvnup-bnd-plugin-upgrade

Conversation

@gnodet

@gnodet gnodet commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Backport of #13001 to maven-4.0.x.

Summary

  • Add maven-bundle-plugin (≥ 5.1.1) and bnd-maven-plugin (≥ 5.1.0) to mvnup's PluginUpgradeStrategy so that mvn mvnup:check / mvn mvnup:apply detects and upgrades these plugins automatically
  • bndlib < 5.1.0 has a bug (FELIX-6259) where Jar.putResource() modifies a collection inside its own computeIfAbsent() call — JDK 17+ backported CME detection (JDK-8259535) that correctly rejects this, causing ConcurrentModificationException on every Maven 4 build using old BND plugins

Fixes #12987

…JDK 17.0.13+ (#13001)

* mvnup: upgrade BND plugins to fix ConcurrentModificationException on JDK 17.0.13+

bndlib < 5.1.0 has a bug (FELIX-6259) where Jar.putResource() modifies
a TreeMap inside its own computeIfAbsent() call. JDK 17.0.13+ backported
CME detection for TreeMap.computeIfAbsent() (JDK-8259535), so Maven 4
(which requires JDK 17+) always hits this with old BND plugin versions.

Add maven-bundle-plugin (>= 5.1.1) and bnd-maven-plugin (>= 5.1.0) to
the mvnup plugin upgrade list so that `mvn mvnup:check` / `mvn mvnup:apply`
detects and upgrades these plugins automatically.

Fixes #12987

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix inaccurate reason text: use generic description matching actual stack traces

The issue's stack trace shows HashMap$HashIterator.nextNode, not
TreeMap.computeIfAbsent — simplify the reason to "internal collection
mutation bugs" which covers both manifestations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 2, 2026
@gnodet gnodet added the bug Something isn't working label Sep 2, 2026
@gnodet gnodet self-assigned this Sep 2, 2026
@gnodet
gnodet merged commit f017145 into maven-4.0.x Sep 2, 2026
24 checks passed
@gnodet
gnodet deleted the backport/13001-mvnup-bnd-plugin-upgrade branch September 2, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant