Skip to content

Commit 250038b

Browse files
authored
Merge pull request #3508 from kalayciburak/fix/feign-bom-flatten-import
Flatten feign-bom so imports do not override consumer dependency management
2 parents 4fb8e61 + 80a8ac7 commit 250038b

5 files changed

Lines changed: 92 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,6 @@ release.properties
7676
pom.xml.releaseBackup
7777
.mvn/.develocity/develocity-workspace-id
7878
.sdkmanrc
79+
80+
# flatten-maven-plugin
81+
.flattened-pom.xml

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Add support for the HTTP QUERY method (RFC 10008) — safe, idempotent, and cacheable with a
44
request body. `HttpCacheInterceptor` includes QUERY in its default cacheable set and
55
incorporates a body hash into the cache key to reduce cross-body collisions.
6+
* Flatten `feign-bom` on install/deploy so importing the BOM does not pull `feign-parent`
7+
dependency management (for example Jackson) into consumer projects such as Spring Boot.
68

79
### Version 13.12
810

feign-bom/pom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,47 @@
262262
</dependencies>
263263
</dependencyManagement>
264264

265+
<!-- Flatten the installed/deployed POM so importing feign-bom does not pull
266+
feign-parent dependencyManagement (e.g. jackson-bom) into consumer projects. -->
267+
<build>
268+
<plugins>
269+
<plugin>
270+
<groupId>org.codehaus.mojo</groupId>
271+
<artifactId>flatten-maven-plugin</artifactId>
272+
<version>${flatten-maven-plugin.version}</version>
273+
<configuration>
274+
<flattenMode>bom</flattenMode>
275+
<pomElements>
276+
<properties>remove</properties>
277+
</pomElements>
278+
</configuration>
279+
<executions>
280+
<execution>
281+
<id>flatten</id>
282+
<goals>
283+
<goal>flatten</goal>
284+
</goals>
285+
<phase>process-resources</phase>
286+
</execution>
287+
<execution>
288+
<id>flatten.clean</id>
289+
<goals>
290+
<goal>clean</goal>
291+
</goals>
292+
<phase>clean</phase>
293+
</execution>
294+
</executions>
295+
</plugin>
296+
<plugin>
297+
<groupId>com.github.ekryd.sortpom</groupId>
298+
<artifactId>sortpom-maven-plugin</artifactId>
299+
<!-- flatten swaps project.file for .flattened-pom.xml, so point sortpom back at
300+
the committed POM to keep it under format enforcement. -->
301+
<configuration>
302+
<pomFile>${project.basedir}/pom.xml</pomFile>
303+
</configuration>
304+
</plugin>
305+
</plugins>
306+
</build>
307+
265308
</project>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
<maven-toolchains-plugin.version>3.3.0</maven-toolchains-plugin.version>
206206
<go-offline-maven-plugin.version>1.2.8</go-offline-maven-plugin.version>
207207
<sortpom-maven-plugin.version>4.0.0</sortpom-maven-plugin.version>
208+
<flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
208209
<rewrite-maven-plugin.version>6.45.0</rewrite-maven-plugin.version>
209210
<rewrite-testing-frameworks.version>3.43.0</rewrite-testing-frameworks.version>
210211
<rewrite-migrate-java.version>3.41.0</rewrite-migrate-java.version>

src/config/bom.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,47 @@
6565
</dependencies>
6666
</dependencyManagement>
6767

68+
<!-- Flatten the installed/deployed POM so importing feign-bom does not pull
69+
feign-parent dependencyManagement (e.g. jackson-bom) into consumer projects. -->
70+
<build>
71+
<plugins>
72+
<plugin>
73+
<groupId>org.codehaus.mojo</groupId>
74+
<artifactId>flatten-maven-plugin</artifactId>
75+
<version>${flatten-maven-plugin.version}</version>
76+
<configuration>
77+
<flattenMode>bom</flattenMode>
78+
<pomElements>
79+
<properties>remove</properties>
80+
</pomElements>
81+
</configuration>
82+
<executions>
83+
<execution>
84+
<id>flatten</id>
85+
<goals>
86+
<goal>flatten</goal>
87+
</goals>
88+
<phase>process-resources</phase>
89+
</execution>
90+
<execution>
91+
<id>flatten.clean</id>
92+
<goals>
93+
<goal>clean</goal>
94+
</goals>
95+
<phase>clean</phase>
96+
</execution>
97+
</executions>
98+
</plugin>
99+
<plugin>
100+
<groupId>com.github.ekryd.sortpom</groupId>
101+
<artifactId>sortpom-maven-plugin</artifactId>
102+
<!-- flatten swaps project.file for .flattened-pom.xml, so point sortpom back at
103+
the committed POM to keep it under format enforcement. -->
104+
<configuration>
105+
<pomFile>${project.basedir}/pom.xml</pomFile>
106+
</configuration>
107+
</plugin>
108+
</plugins>
109+
</build>
110+
68111
</project>

0 commit comments

Comments
 (0)