Skip to content

Commit

Permalink
do not flatten with OSS mode
Browse files Browse the repository at this point in the history
the OSS mode despite saying it keeps everything "repositories and
pluginRepositories" does not and it throws away the dependencyManagement

this creates our own descriptor that dies the same as the oss mode
currently but additionally keeps the dependencyManagement section

Whilst we could have used resolveCiFriendliesOnly which is probably a
better solution so that the poms behave better regardless of if they are
deployed from CI or local snapshots this keeps the changes to published
poms minimal
  • Loading branch information
jtnord committed Mar 9, 2023
1 parent 2644ab7 commit 30885c8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,25 @@
</goals>
<phase>process-resources</phase>
<configuration>
<flattenMode>oss</flattenMode>
<!-- flattenMode:oss does not keep dependecnyMangement or will promote all transitive dependencies to direct ones, changing resolution order -->
<pomElements>
<dependencyManagement>interpolate</dependencyManagement>
<!-- from https://github.com/mojohaus/flatten-maven-plugin/blob/flatten-maven-plugin-1.3.0/src/main/java/org/codehaus/mojo/flatten/FlattenMode.java#L100 -->
<ciManagement>expand</ciManagement>
<contributors>expand</contributors>
<distributionManagement>expand</distributionManagement>
<inceptionYear>expand</inceptionYear>
<issueManagement>expand</issueManagement>
<mailingLists>expand</mailingLists>
<organization>expand</organization>
<prerequisites>expand</prerequisites>
<name>expand</name>
<description>expand</description>
<url>expand</url>
<scm>expand</scm>
<developers>expand</developers>
<repositories>expand</repositories>
</pomElements>
<outputDirectory>${project.build.directory}</outputDirectory>
<flattenedPomFilename>${project.artifactId}-${project.version}.pom</flattenedPomFilename>
</configuration>
Expand Down

0 comments on commit 30885c8

Please sign in to comment.