maven-help-plugin icon indicating copy to clipboard operation
maven-help-plugin copied to clipboard

[MPH-175] mvn help:effective-pom leaves <parent> pom in place

Open jira-importer opened this issue 4 years ago • 1 comments

Georg Lippold opened MPH-175 and commented

When executing mvn help:effective-pom, the <parent> XML node is left intact. The <parent> should be removed in the effective POM.

If you generate the effective pom to modify the project, e.g. to remove or override settings that are present in the parent pom, then including the <parent> node in the resulting XML re-introduces the settings that you wanted to modify.

Example: <parent> specifies a setting, e.g.

<project>
  <properties>
    <format>HTML</format>
  </properties>
</project>

If the <format> node is now removed from the effective POM, then it is re-introduced by including the <parent> in every maven run. The parent POM should not be required anymore in an effective POM, because all its settings should already be included in the effective POM.


Affects: 3.2.0

jira-importer avatar Jul 05 '21 02:07 jira-importer

Jeremie Bresson commented

I think the feature you are interested in is provided by the flatten-maven-plugin https://www.mojohaus.org/flatten-maven-plugin/index.html

<dependency>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>flatten-maven-plugin</artifactId>
    <version>${version}</version>
</dependency>

jira-importer avatar Aug 30 '24 12:08 jira-importer