This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch pd-store
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git
The following commit(s) were added to refs/heads/pd-store by this push:
new c70a2944b fix: assemble executable jar for pd and store (#2289)
c70a2944b is described below
commit c70a2944b07f6ec31a751beee26cd0e4df93f876
Author: V_Galaxy <[email protected]>
AuthorDate: Tue Aug 29 18:43:36 2023 +0800
fix: assemble executable jar for pd and store (#2289)
Due to the change of hugegraph-pd's parent from spring-boot-starter-parent
to hugegraph, and hugegraph's parent being apache, along with modifications to
the artifactId of certain sub-modules (for example, hugegraph-pd to
hg-pd-service), the following steps need to be taken:
Modify the descriptor of the maven-assembly-plugin, which involves
adjusting the collected jar package names accordingly.
- Update the corresponding jar package names in the startup script.
- Since hugegraph-pd is started using Spring Boot, the
spring-boot-maven-plugin needs to be reconfigured.
---------
Co-authored-by: imbajin <[email protected]>
---
hugegraph-pd/hg-pd-dist/pom.xml | 2 +-
.../src/assembly/static/bin/start-hugegraph-pd.sh | 4 ++--
hugegraph-pd/hg-pd-service/pom.xml | 11 ++++++++++-
.../java/org/apache/hugegraph/pd/rest/IndexAPI.java | 3 ++-
hugegraph-store/hg-store-dist/pom.xml | 1 +
.../src/assembly/descriptor/server-assembly.xml | 4 ++--
.../src/assembly/static/bin/start-hugegraph-store.sh | 2 +-
hugegraph-store/hg-store-node/pom.xml | 17 +++++++++++------
8 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/hugegraph-pd/hg-pd-dist/pom.xml b/hugegraph-pd/hg-pd-dist/pom.xml
index 58cd86250..3cb51b393 100644
--- a/hugegraph-pd/hg-pd-dist/pom.xml
+++ b/hugegraph-pd/hg-pd-dist/pom.xml
@@ -36,7 +36,7 @@
<assembly.descriptor.dir>${assembly.dir}/descriptor</assembly.descriptor.dir>
<assembly.static.dir>${assembly.dir}/static</assembly.static.dir>
<final.name>hugegraph-pd-${project.parent.version}</final.name>
- <executable.jar.name>hugegraph-pd</executable.jar.name>
+ <executable.jar.name>hg-pd-service</executable.jar.name>
</properties>
<dependencies>
diff --git
a/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh
b/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh
index df44dd107..05b3921c7 100644
--- a/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh
+++ b/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh
@@ -114,8 +114,8 @@ fi
echo "Starting HugeGraphPDServer..."
# Turn on security check
-exec ${JAVA} ${JAVA_OPTIONS} -jar
-Dspring.config.location=${CONF}/application.yml \
- ${LIB}/hugegraph-pd-*.jar >> ${OUTPUT} 2>&1 &
+exec ${JAVA} -Dname="HugeGraphPD" ${JAVA_OPTIONS} -jar \
+ -Dspring.config.location=${CONF}/application.yml
${LIB}/hg-pd-service-*.jar >> ${OUTPUT} 2>&1 &
PID="$!"
# Write pid to file
diff --git a/hugegraph-pd/hg-pd-service/pom.xml
b/hugegraph-pd/hg-pd-service/pom.xml
index e7f51323c..ca2e68d94 100644
--- a/hugegraph-pd/hg-pd-service/pom.xml
+++ b/hugegraph-pd/hg-pd-service/pom.xml
@@ -120,6 +120,12 @@
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-common</artifactId>
<version>1.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -138,11 +144,14 @@
<executions>
<execution>
<configuration>
- <classifier>spring-boot</classifier>
<mainClass>
org.apache.hugegraph.pd.boot.HugePDServer
</mainClass>
</configuration>
+ <!-- should configure explicitly without
spring-boot-starter-parent -->
+ <goals>
+ <goal>repackage</goal>
+ </goals>
</execution>
</executions>
</plugin>
diff --git
a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/IndexAPI.java
b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/IndexAPI.java
index 0d0cebb3e..6b1113a2e 100644
---
a/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/IndexAPI.java
+++
b/hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/IndexAPI.java
@@ -15,6 +15,8 @@
* under the License.
*/
+package org.apache.hugegraph.pd.rest;
+
import java.lang.management.ManagementFactory;
import java.util.ArrayList;
import java.util.List;
@@ -25,7 +27,6 @@ import org.apache.hugegraph.pd.grpc.Metapb;
import org.apache.hugegraph.pd.grpc.Pdpb;
import org.apache.hugegraph.pd.model.RestApiResponse;
import org.apache.hugegraph.pd.raft.RaftEngine;
-import org.apache.hugegraph.pd.rest.API;
import org.apache.hugegraph.pd.rest.MemberAPI.CallStreamObserverWrap;
import org.apache.hugegraph.pd.service.PDRestService;
import org.apache.hugegraph.pd.service.PDService;
diff --git a/hugegraph-store/hg-store-dist/pom.xml
b/hugegraph-store/hg-store-dist/pom.xml
index 5d8030e08..9c548e061 100644
--- a/hugegraph-store/hg-store-dist/pom.xml
+++ b/hugegraph-store/hg-store-dist/pom.xml
@@ -38,6 +38,7 @@
<assembly.descriptor.dir>${assembly.dir}/descriptor</assembly.descriptor.dir>
<assembly.static.dir>${assembly.dir}/static</assembly.static.dir>
<final.name>hugegraph-store-${revision}</final.name>
+ <executable.jar.name>hg-store-node</executable.jar.name>
</properties>
<dependencies>
<dependency>
diff --git
a/hugegraph-store/hg-store-dist/src/assembly/descriptor/server-assembly.xml
b/hugegraph-store/hg-store-dist/src/assembly/descriptor/server-assembly.xml
index 44001cffb..79dd4cdd0 100644
--- a/hugegraph-store/hg-store-dist/src/assembly/descriptor/server-assembly.xml
+++ b/hugegraph-store/hg-store-dist/src/assembly/descriptor/server-assembly.xml
@@ -51,9 +51,9 @@
<scope>runtime</scope>
<useProjectArtifact>false</useProjectArtifact>
<includes>
- <include>org.apache.hugegraph:hugegraph-store:jar:*</include>
+
<include>org.apache.hugegraph:${executable.jar.name}:jar:*</include>
</includes>
</dependencySet>
</dependencySets>
-</assembly>
\ No newline at end of file
+</assembly>
diff --git
a/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh
b/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh
index 242c41791..4bf1e8534 100644
---
a/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh
+++
b/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh
@@ -158,7 +158,7 @@ echo "Starting HG-StoreServer..."
exec ${JAVA} -Dname="HugeGraphStore" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \
-Dspring.config.location=${CONF}/application.yml \
- ${LIB}/hugegraph-store-*.jar >> ${OUTPUT} 2>&1 &
+ ${LIB}/hg-store-node-*.jar >> ${OUTPUT} 2>&1 &
PID="$!"
# Write pid to file
diff --git a/hugegraph-store/hg-store-node/pom.xml
b/hugegraph-store/hg-store-node/pom.xml
index bed0566ab..22bffb49c 100644
--- a/hugegraph-store/hg-store-node/pom.xml
+++ b/hugegraph-store/hg-store-node/pom.xml
@@ -43,11 +43,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-log4j2</artifactId>
- <version>2.5.14</version>
- </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
@@ -149,7 +144,16 @@
<version>3.6.4</version>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>2.17.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>2.17.2</version>
+ </dependency>
<!-- module end -->
</dependencies>
@@ -168,6 +172,7 @@
<mainClass>
org.apache.hugegraph.store.node.StoreNodeApplication
</mainClass>
+ <includeSystemScope>true</includeSystemScope>
</configuration>
</execution>
</executions>