Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,14 @@
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
</plugin>
Comment on lines +64 to +67
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While adding the maven-shade-plugin is correct for bundling dependencies, it's a best practice to also relocate the packages of the shaded dependencies. This prevents potential classpath conflicts if other parts of the application or other plugins use different versions of the same libraries (like Micrometer or Prometheus client). I suggest adding a <configuration> section with <relocations> to move the shaded packages into a private namespace within the arcadedb-metrics artifact.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>io.micrometer</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.io.micrometer</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>io.prometheus</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.io.prometheus</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.hdrhistogram</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.org.hdrhistogram</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.latencyutils</pattern>
                            <shadedPattern>com.arcadedb.metrics.shaded.org.latencyutils</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </plugin>

</plugins>
</build>

</project>
11 changes: 9 additions & 2 deletions package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,20 @@
</dependency>
<dependency>
<groupId>com.arcadedb</groupId>
<artifactId>arcadedb-metrics</artifactId>
<artifactId>arcadedb-studio</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>com.arcadedb</groupId>
<artifactId>arcadedb-studio</artifactId>
<artifactId>arcadedb-metrics</artifactId>
<version>${project.parent.version}</version>
<classifier>shaded</classifier>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.arcadedb</groupId>
Expand Down
13 changes: 1 addition & 12 deletions studio/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading