Skip to content

guide-mixins: add 'Mixins vs. Packaging' section - #1802

Open
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:guide-mixins-vs-packaging
Open

gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:guide-mixins-vs-packaging

Conversation

@gnodet

@gnodet gnodet commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Enhances the Maven Mixins guide with a new "Mixins vs. Packaging" section that explains when to use each mechanism.

The question came up naturally while working on apache/maven#13658 (the maven-plugin-mixin — a JSR 269 annotation processor delivered as a mixin to replace <packaging>maven-plugin</packaging> for Maven 4 plugins).

What's added

  • Explains the two roles of <packaging>: artifact type declaration (backed by ArtifactHandler) and lifecycle binding injection (backed by LifecycleMappingProvider)
  • Explains what mixins do: POM-level composition via plugin/dep/property merging
  • Decision guide: clear bullet lists for when to use each
  • Concrete example: the maven-plugin-mixin pattern that replaces <packaging>maven-plugin</packaging> in Maven 4, including the bootstrap problem it solves
  • Summary comparison table

Also fixes a tense issue in the intro ("will provide" changed to "provide") since Maven 4.1 has shipped.

Related

Clarifies when to use a mixin vs. a custom packaging type:
- packaging owns artifact type + lifecycle binding at SPI level
- mixins cover POM-level composition (plugins, deps, properties)
- illustrates with the maven-plugin-mixin pattern from apache/maven#13658

Also updates the intro tense ('will provide' → 'provide') since
Maven 4.1 has shipped.
# Maven Mixins (Maven 4.1)

Maven Mixins will provide (in Maven 4.1) a powerful mechanism for sharing common POM configuration across multiple projects without the limitations of traditional inheritance. Mixins allow you to compose your project configuration from multiple sources, promoting better code reuse and maintainability.
Maven Mixins provide (since Maven 4.1) a powerful mechanism for sharing common POM configuration across multiple projects without the limitations of traditional inheritance. Mixins allow you to compose your project configuration from multiple sources, promoting better code reuse and maintainability.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need to adjust several places in the site where we talk about Maven 4.1, when the PR to skip it in favor to 4.2.0.

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