Keep comments on flattened pom (original) (raw)
We are using resolveCiFriendliesOnly for all our projects with
...
<version.flatten-maven-plugin>1.2.7</version.flatten-maven-plugin>
...
<plugin>
<!-- for https://maven.apache.org/maven-ci-friendly.html -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${version.flatten-maven-plugin}</version>
<configuration>
<!-- The flag to indicate if the generated flattened POM shall be set as POM file -->
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten-resolveCiFriendliesOnly</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
and the generated .flattened-pom.xml no longer contains any comment.
As the original pom.xml is available in the SourceCodeManagement only (or on some developer locals) most developers are accessing the "pom.xml" by looking in our nexus-repository via maven-pom-editors function.
We have some nice comments in front of some properties, for example
<!-- https://github.com/spring-projects/spring-framework/releases -->
<springVersion>5.3.18</springVersion>
but in the nexus (flattened-pom) they are no longer visible.
Would be nice to keep comments during flatten process.