Skip to content

Commit

Permalink
maven: ensure that we have unique file names to conflicting jars
Browse files Browse the repository at this point in the history
Motivation:
codahal metrics and yammer metric have the same jar name
metrics-core.jar. Though, this is not an issue but looks like two
versions of the same jar.

Modification:
in assembly step rename one of the jars to make it more clear that those
are different artefacts.

Result:
less confusion by jar names

Acked-by: Lea Morschel
Target: master
Require-book: no
Require-notes: no
  • Loading branch information
kofemann committed Aug 29, 2024
1 parent 60292c7 commit d4c2c75
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ container:
Check for duplicate dependencies:
stage: build
image: almalinux:9-minimal
allow_failure: true
needs:
- tar
dependencies:
Expand Down
12 changes: 12 additions & 0 deletions packages/fhs/src/main/assembly/fhs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<!-- Two dependencies same name. Rename one of them -->
<dependencySet>
<includes>
<include>io.dropwizard.metrics:metrics-core</include>
</includes>
<outputDirectory>usr/share/dcache/classes</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>dropwizard-metrics-core-${version.dropwizard}.jar</outputFileNameMapping>
<fileMode>644</fileMode>
<directoryMode>755</directoryMode>
</dependencySet>
<dependencySet>
<excludes>
<exclude>org.dcache:dcache-view:jar:*</exclude>
<exclude>org.dcache:dcache-view-admin:jar:*</exclude>
<exclude>io.dropwizard.metrics:metrics-core</exclude>
</excludes>
<outputDirectory>usr/share/dcache/classes</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
Expand Down
12 changes: 12 additions & 0 deletions packages/system-test/src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
<!-- Two dependencies same name. Rename one of them -->
<dependencySet>
<includes>
<include>io.dropwizard.metrics:metrics-core</include>
</includes>
<outputDirectory>share/classes</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>dropwizard-metrics-core-${version.dropwizard}.jar</outputFileNameMapping>
<fileMode>644</fileMode>
<directoryMode>755</directoryMode>
</dependencySet>
<dependencySet>
<excludes>
<exclude>*:*:war:*</exclude>
<exclude>org.dcache:dcache-plugin-hsqldb:zip:*</exclude>
<exclude>org.dcache:dcache-view:jar:*</exclude>
<exclude>org.dcache:dcache-view-admin:jar:*</exclude>
<exclude>io.dropwizard.metrics:metrics-core</exclude>
</excludes>
<outputDirectory>share/classes</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
Expand Down
12 changes: 12 additions & 0 deletions packages/tar/src/main/assembly/tar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@
<includeBaseDirectory>true</includeBaseDirectory>

<dependencySets>
<!-- Two dependencies same name. Rename one of them -->
<dependencySet>
<includes>
<include>io.dropwizard.metrics:metrics-core</include>
</includes>
<outputDirectory>share/classes</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<outputFileNameMapping>dropwizard-metrics-core-${version.dropwizard}.jar</outputFileNameMapping>
<fileMode>644</fileMode>
<directoryMode>755</directoryMode>
</dependencySet>
<dependencySet>
<excludes>
<exclude>*:*:war:*</exclude>
<exclude>org.dcache:dcache-view:jar:*</exclude>
<exclude>org.dcache:dcache-view-admin:jar:*</exclude>
<exclude>io.dropwizard.metrics:metrics-core</exclude>
</excludes>
<outputDirectory>share/classes</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<version.jackson>2.14.0</version.jackson>
<version.jna>5.4.0</version.jna>
<jmh.version>1.35</jmh.version>
<version.dropwizard>4.1.29</version.dropwizard>



Expand Down Expand Up @@ -206,7 +207,7 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>4.1.29</version>
<version>${version.dropwizard}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down

0 comments on commit d4c2c75

Please sign in to comment.