Skip to content

Commit

Permalink
fix(interactive): Shade Scala Package in Neo4j to Avoid Conflicts (#4175
Browse files Browse the repository at this point in the history
)

Fixes #2890
  • Loading branch information
shirly121 authored Aug 23, 2024
1 parent 890b7ec commit 4a14dd7
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ interactive_engine/executor/store/groot/src/db/proto/*
!interactive_engine/executor/store/groot/src/db/proto/mod.rs
interactive_engine/data-load-tool/dependency-reduced-pom.xml
interactive_engine/gaia-adaptor/dependency-reduced-pom.xml
interactive_engine/neo4j-shaded/dependency-reduced-pom.xml
interactive_engine/executor/Cargo.lock
interactive_engine/executor/engine/pegasus/benchmark/src/graph/storage/clickhouse/pb_gen/*
interactive_engine/executor/ir/Cargo.lock
Expand Down
79 changes: 79 additions & 0 deletions interactive_engine/neo4j-shaded/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<properties>
<neo4j.version>4.4.0</neo4j.version>
<neo4j.scala.library.version>2.12.10</neo4j.scala.library.version>
<neo4j.scala.reflect.version>2.12.13</neo4j.scala.reflect.version>
<maven.shade.plugin.version>3.4.1</maven.shade.plugin.version>
</properties>

<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j.version}-SHADED</version>

<dependencies>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j.version}</version>
</dependency>

<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${neo4j.scala.library.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${neo4j.scala.reflect.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<relocations>
<!-- Relocate Scala packages only from Neo4j dependencies -->
<relocation>
<pattern>scala</pattern>
<shadedPattern>neo4j.shaded.scala</shadedPattern>
</relocation>
</relocations>
<transformers>
<!-- Merge all META-INF/services files -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
30 changes: 29 additions & 1 deletion interactive_engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<properties>
<rust.compile.target>groot</rust.compile.target>
<scala.version>2.13.9</scala.version>
<neo4j.version>4.4.0-SHADED</neo4j.version>
</properties>
<modules>
<module>assembly</module>
Expand All @@ -82,6 +83,32 @@
<module>executor/engine/pegasus/clients/java/client</module>
<module>compiler</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>shade-neo4j</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<arguments>
<argument>-f</argument>
<argument>neo4j-shaded/pom.xml</argument>
<argument>install</argument>
</arguments>
</configuration>
</execution>
</executions>
<inherited>false</inherited>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>groot-data-load</id>
Expand Down Expand Up @@ -225,6 +252,7 @@
<maven.compiler.target>1.8</maven.compiler.target>

<neo4j.version>4.4.0</neo4j.version>
<neo4j.driver.version>4.4.0</neo4j.driver.version>
<interactive.sdk.version>0.4</interactive.sdk.version>
</properties>

Expand Down Expand Up @@ -647,7 +675,7 @@
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>${neo4j.version}</version>
<version>${neo4j.driver.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 4a14dd7

Please sign in to comment.