Skip to content

Commit

Permalink
refactor(interactive): Resolve the dependency problem between compile…
Browse files Browse the repository at this point in the history
…r and interactive SDK (#4284)

The Interactive SDK and compiler both rely on gaia-ir-proto, including
the protoc-generated classes. Previously, we used the maven-shade-plugin
to shade the protoc files from the Interactive SDK, but this led to
other build issues, as noted in PR #4255.

In this PR, we address the problem by adding an additional jar
classifier, `no-gaia-ir`, which can be easily utilized by the compiler.
  • Loading branch information
zhanglei1949 authored Oct 11, 2024
1 parent ae4e9a2 commit 44599e4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
21 changes: 20 additions & 1 deletion flex/interactive/sdk/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Add this dependency to your project's POM:
<groupId>com.alibaba.graphscope</groupId>
<artifactId>interactive</artifactId>
<version>0.3</version>
<scope>compile</scope>
</dependency>
```

Expand Down Expand Up @@ -93,4 +92,24 @@ public class GettingStarted {

For more a more detailed example, please refer to [Java SDK Example](https://github.com/alibaba/GraphScope/flex/interactive/sdk/examples/java/interactive-example/)

### Advanced building

In some cases, you may want to exclude the proto-generated gaia-related files from the jar. You could use the jar with classifier `no-gaia-ir`.

```xml
<dependency>
<groupId>com.alibaba.graphscope</groupId>
<artifactId>interactive</artifactId>
<version>0.3</version>
<classifier>no-gaia-ir</classifier>
</dependency>
```

To release the jar to a remote repository, you can use the following command:

```bash
mvn clean deploy -Psign-artifacts
```



12 changes: 9 additions & 3 deletions flex/interactive/sdk/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,18 @@
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
<goal>jar</goal>
</goals>
<configuration>
<excludes>
<exclude>com/alibaba/graphscope/gaia/**</exclude>
</excludes>
<classifier>${no-gaia-ir-classifier}</classifier>
</configuration>
</execution>
</executions>
<configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down Expand Up @@ -534,5 +539,6 @@
<opentelemetry-bom.version>1.37.0</opentelemetry-bom.version>
<javadoc.output.destDir>${project.build.directory}/javadoc</javadoc.output.destDir>
<javadoc.output.destDir>reference</javadoc.output.destDir>
<no-gaia-ir-classifier>no-gaia-ir</no-gaia-ir-classifier>
</properties>
</project>
1 change: 1 addition & 0 deletions interactive_engine/compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
<dependency>
<groupId>com.alibaba.graphscope</groupId>
<artifactId>interactive</artifactId>
<classifier>${interactive.sdk.classifier}</classifier>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
34 changes: 3 additions & 31 deletions interactive_engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@

<neo4j.version>4.4.0</neo4j.version>
<neo4j.driver.version>4.4.0</neo4j.driver.version>
<interactive.sdk.version>0.4</interactive.sdk.version>
<interactive.sdk.version>0.4.2</interactive.sdk.version>
<interactive.sdk.classifier>no-gaia-ir</interactive.sdk.classifier>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -695,6 +696,7 @@
<groupId>com.alibaba.graphscope</groupId>
<artifactId>interactive</artifactId>
<version>${interactive.sdk.version}</version>
<classifier>${interactive.sdk.classifier}</classifier>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -734,36 +736,6 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven.deploy.version}</version>
</plugin>
<!-- <plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>com.alibaba.graphscope:interactive</artifact>
<excludes>
<exclude>com.alibaba.graphscope.gaia.proto.*</exclude>
</excludes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin> -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly.version}</version>
Expand Down

0 comments on commit 44599e4

Please sign in to comment.