Skip to content

[MPH-217] Ensure packaging is always shown in effective-pom output - #405

Open
elharo wants to merge 1 commit into
masterfrom
fix-mph-217
Open

[MPH-217] Ensure packaging is always shown in effective-pom output#405
elharo wants to merge 1 commit into
masterfrom
fix-mph-217

Conversation

@elharo

@elharo elharo commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Problem: help:effective-pom does not show the <packaging> element when the packaging is not explicitly set in the POM (defaulting to jar). MavenXpp3Writer intentionally omits the <packaging> element when it is null or equals "jar" (the default), so users cannot see the effective packaging value.

Fix: After serialization, detect if the <packaging> element is missing and insert it into the XML output if so. This ensures the effective packaging value is always visible.

Test: Added an integration test (effective-pom-packaging) with a POM that has no <packaging> element, verifying the output contains <packaging>jar</packaging>.

Fixes #332

MavenXpp3Writer omits the packaging element when it is null or equals
the default value 'jar'. This leads help:effective-pom to not show
the packaging at all when it is not explicitly set in the POM.

Fix: after serialization, insert the packaging element into the XML
output if missing. This ensures users can always see the effective
packaging value (e.g. jar, pom, war) in the effective POM output.

Includes an integration test with a POM that has no packaging element,
verifying the output contains <packaging>jar</packaging>.
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.

[MPH-217] help:effective-pom does not show the value for a POM's "packaging"

1 participant