Skip to content

Move Jackson 3 JMH benchmarks into a separate unpublished project - #1017

Merged
xerial merged 1 commit into
msgpack:jackson3-migrationfrom
komamitsu:move-jmh-benchmarks-to-subproject
Aug 13, 2026
Merged

Move Jackson 3 JMH benchmarks into a separate unpublished project#1017
xerial merged 1 commit into
msgpack:jackson3-migrationfrom
komamitsu:move-jmh-benchmarks-to-subproject

Conversation

@komamitsu

Copy link
Copy Markdown
Member

Fixes a packaging problem I introduced in #987.

JmhPlugin adds jmh-core, jmh-generator-bytecode and jmh-generator-reflection to libraryDependencies without a configuration. Since #987 enabled it on msgpack-jackson3, which is published, those three become compile dependencies of org.msgpack.jackson3:jackson-dataformat-msgpack and are inherited by every consumer along with jopt-simple, commons-math3 and asm:

<dependency><groupId>org.openjdk.jmh</groupId><artifactId>jmh-core</artifactId><version>1.37</version></dependency>
<dependency><groupId>org.openjdk.jmh</groupId><artifactId>jmh-generator-bytecode</artifactId><version>1.37</version></dependency>
<dependency><groupId>org.openjdk.jmh</groupId><artifactId>jmh-generator-reflection</artifactId><version>1.37</version></dependency>

The released org.msgpack:jackson-dataformat-msgpack:0.9.11 POM has no such entries.

Fix

Move msgpack-jackson3/src/jmh into a new msgpack-jackson3-benchmark project with publish / skip := true that depends on msgpack-jackson3, and drop JmhPlugin from the published module. This is the layout sbt-jmh's README asks for, since the generator needs a project of its own and the benchmark subproject should not be published.

Verification

  • msgpack-jackson3/makePom: msgpack-core and jackson-databind are the only compile-scope dependencies left, alongside the usual test-scoped entries
  • msgpack-jackson3/libraryDependencies: no JMH at all
  • msgpack-jackson3-benchmark/Jmh/compile: generator processes 11 classes, compiles 29 generated sources
  • test: msgpack-core 193, msgpack-jackson 77, msgpack-jackson3 123
  • jcheckStyle, scalafmtCheckAll, scalafmtSbtCheck: clean

The benchmark project is aggregated into the root next to msgpack-jackson3. Note that src/jmh is not compiled by test in either layout, so CI does not verify the benchmarks build.

JmhPlugin adds jmh-core, jmh-generator-bytecode and jmh-generator-reflection to
libraryDependencies without a configuration, so enabling it on msgpack-jackson3
published them as compile dependencies of jackson-dataformat-msgpack, inherited
by every consumer along with jopt-simple, commons-math3 and ASM. The released
org.msgpack:jackson-dataformat-msgpack POM has no such entries.

Move src/jmh into msgpack-jackson3-benchmark, which depends on msgpack-jackson3
and is not published. This is also how sbt-jmh recommends laying out benchmarks,
since the code generator needs a project of its own.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@xerial
xerial merged commit 32d1c71 into msgpack:jackson3-migration Aug 13, 2026
11 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.

3 participants