Skip to content

Commit

Permalink
Exclude Multi-Release files from Jackson while shading (#2793)
Browse files Browse the repository at this point in the history
Cucumber-JVM uses Jackson Databind to write json. Because Jackson is a very
common dependency, to ensure we do not interfere with the system under test,
we shade it.

Unfortunately the Shade plugin occasionally gets updates and now includes
multi-releases. These were not included in the relocation pattern and
result in duplicate classes when Cucumber itself is shaded.

As `cucumber-core` is not a multi-release jar, we can exclude the multi-
release files altogether.

Fixes: #2786
  • Loading branch information
mpkorstanje authored Sep 9, 2023
1 parent b0a4373 commit 3165714
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- [Core] Exclude Multi-Release files from Jackson while shading ([#2786](https://github.com/cucumber/cucumber-jvm/pull/2786) M.P. Korstanje)

## [7.13.0] - 2023-07-02
### Changed
- [TestNG] Update dependency org.testng:testng to v7.8.0
Expand Down
14 changes: 8 additions & 6 deletions cucumber-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
</transformer>
</transformers>
<artifactSet>
<includes>
<include>com.fasterxml.jackson.core:jackson-databind</include>
Expand All @@ -253,35 +259,31 @@
<exclude>**/module-info.class</exclude>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/services/**</exclude>
<exclude>META-INF/versions/**</exclude>
</excludes>
</filter>
<filter>
<artifact>com.fasterxml.jackson.core:jackson-core</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/NOTICE</exclude>
<exclude>META-INF/services/**</exclude>
<exclude>META-INF/versions/**</exclude>
</excludes>
</filter>
<filter>
<artifact>com.fasterxml.jackson.core:jackson-annotations</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/LICENSE</exclude>
</excludes>
</filter>
<filter>
<artifact>com.fasterxml.jackson.datatype:jackson-datatype-jdk8</artifact>
<excludes>
<exclude>**/module-info.class</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/LICENSE</exclude>
<exclude>META-INF/services/**</exclude>
</excludes>
</filter>
Expand Down

0 comments on commit 3165714

Please sign in to comment.