Skip to content

Mark codegen Maven plugin as thread-safe#445

Merged
EricWittmann merged 1 commit into
mainfrom
mark-maven-plugin-thread-safe
Jul 2, 2026
Merged

Mark codegen Maven plugin as thread-safe#445
EricWittmann merged 1 commit into
mainfrom
mark-maven-plugin-thread-safe

Conversation

@EricWittmann

Copy link
Copy Markdown
Contributor

Summary

  • Add threadSafe = true to the @Mojo annotation on GenerateCodeMojo to eliminate the
    Maven warning when parallel builds (-T) are enabled.
  • Switch the static TYPE_CACHE in OpenApi2JaxRs from HashMap to ConcurrentHashMap to
    ensure correctness under concurrent access.

Test plan

  • Build the project successfully (./build.sh)
  • Use the plugin in a downstream project with mvn -T 4 install and confirm the warning
    no longer appears

Add threadSafe = true to the @mojo annotation so Maven no longer warns
when parallel builds are enabled.  Also switch the static TYPE_CACHE from
HashMap to ConcurrentHashMap to ensure correctness under concurrent access.
@EricWittmann
EricWittmann merged commit 5e5ff5f into main Jul 2, 2026
2 checks passed
@EricWittmann
EricWittmann deleted the mark-maven-plugin-thread-safe branch July 2, 2026 14:05
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.

1 participant