Skip to content

Narrow Jackson and SnakeYAML to test scope - #660

Merged
slachiewicz merged 1 commit into
masterfrom
agent/narrow-generated-code-deps
Dec 2, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/narrow-generated-code-deps

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Narrows jackson-core, jackson-databind and jackson-annotations in modello-plugin-jackson, and snakeyaml in modello-plugin-snakeyaml, to test scope. The generators never load these libraries: they write the class names into the sources they generate, and only the tests compile and run that generated code.

The runtime classpath of modello-maven-plugin loses three jars (dependency:list -DincludeScope=runtime):

-   com.fasterxml.jackson.core:jackson-annotations:jar:2.23:runtime
-   com.fasterxml.jackson.core:jackson-databind:jar:2.23.0:runtime
-   org.yaml:snakeyaml:jar:2.7:runtime

jackson-core stays, because modello-plugin-jsonschema uses it to write the schema.

Compatibility: a project that depends on modello-plugin-jackson or modello-plugin-snakeyaml as a library no longer gets Jackson or SnakeYAML through it. A project that compiles generated readers and writers has to declare the library itself, as it already must when it runs the generator through the Maven plugin.

Verified: mvn -B install on JDK 17 → BUILD SUCCESS, 180 tests. I have not run the run-its profile locally.

Part of codehaus-plexus/.github#94.

The generators only write the names of these classes into the code they
generate. The libraries are needed to compile that code in the tests, not
to run the generators.
@slachiewicz slachiewicz added the dependencies Pull requests that update a dependency file label Dec 2, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review December 2, 2026 14:35
@slachiewicz
slachiewicz merged commit f251643 into master Dec 2, 2026
13 checks passed
@slachiewicz
slachiewicz deleted the agent/narrow-generated-code-deps branch December 2, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant