Skip to content

[MDEP-803] Preserve parent POMs when copying classified dependencies - #1696

Open
wilx wants to merge 2 commits into
apache:masterfrom
wilx:issue-1312-parent-poms-with-classifier
Open

wilx wants to merge 2 commits into
apache:masterfrom
wilx:issue-1312-parent-poms-with-classifier

Conversation

@wilx

@wilx wilx commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

With copy-dependencies, combining addParentPoms=true and classifier=sources attempts to resolve parent POMs as *-sources.pom. Those missing artifacts are silently omitted by default, or fail the build when failOnMissingClassifierArtifact=true.

Keep automatically added parent POMs separate from dependencies during classifier/type translation, while retaining inclusion/exclusion filters and overwrite handling. Explicit classified POM dependencies still work, including a POM that is also used as a parent. Clarify this interaction in the parameter documentation.

Fixes #1312 (MDEP-803).

Tests

The first commit adds an Invoker regression, verified failing on the missing project and dependency parent POMs before the second commit applies the fix. It covers parent ancestry, a parent also declared as a dependency, explicit classified POMs, a type override, exclusions, and repository layout.

Validated with Maven 3.9.16 and Java 21:

  • mvn spotless:apply — clean.
  • mvn -Prun-its clean install — 435 unit tests, no failures/errors, 1 existing skip; all 103 integration tests passed.
  • Original standalone reproducer — both parent POMs copied in normal and strict modes; repeat execution with existing output also passed.

Checklist

  • The pull request addresses one issue without unrelated changes.
  • The description explains what changes, how, and why.
  • Commits have meaningful subjects; the implementation commit includes the rationale.
  • Add unit tests for the behavior change. Regression coverage is provided by a Maven Invoker integration test that fails without the fix.
  • Run mvn verify — included in the successful clean install lifecycle.
  • Run integration tests with -Prun-its.
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.
  • In any other case, please file an Apache Individual Contributor License Agreement.

Collect and filter parent POMs separately so classifier and type translation only applies to dependencies. Preserve explicit classified POMs, including artifacts that are also used as parents, and document the parameter interaction.

Fixes apache#1312.
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.

[MDEP-803] addParentPoms only partially working

1 participant