This is an automated email from the ASF dual-hosted git repository.

Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d3f142849 fix: collector boot fails when jar manifest lacks 
Class-Path (#4190)
0d3f142849 is described below

commit 0d3f1428499dbf483918549704750a6dec4e66cc
Author: NekoPunch <[email protected]>
AuthorDate: Tue Jul 14 00:36:09 2026 -0700

    fix: collector boot fails when jar manifest lacks Class-Path (#4190)
    
    Co-authored-by: aias00 <[email protected]>
---
 .github/workflows/nightly-build.yml                |  2 +-
 .../hertzbeat-collector-collector/pom.xml          | 74 ++++++++--------------
 script/assembly/collector/bin/entrypoint.sh        |  3 +-
 script/assembly/collector/bin/startup.bat          |  3 +-
 script/assembly/collector/bin/startup.sh           |  3 +-
 script/assembly/server/bin/entrypoint.sh           |  3 +-
 script/assembly/server/bin/startup.bat             |  3 +-
 script/assembly/server/bin/startup.sh              |  3 +-
 8 files changed, 39 insertions(+), 55 deletions(-)

diff --git a/.github/workflows/nightly-build.yml 
b/.github/workflows/nightly-build.yml
index 453649e98d..2e9f339eaf 100644
--- a/.github/workflows/nightly-build.yml
+++ b/.github/workflows/nightly-build.yml
@@ -52,7 +52,7 @@ jobs:
 
     - name: Build the Backend
       run: |
-        mvnd -B clean package -Prelease,Pcluster -Dmaven.test.skip=false 
--file pom.xml
+        mvnd -B clean package -Prelease,cluster -Dmaven.test.skip=false --file 
pom.xml
 
     - uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
     - uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
diff --git a/hertzbeat-collector/hertzbeat-collector-collector/pom.xml 
b/hertzbeat-collector/hertzbeat-collector-collector/pom.xml
index 2e0a08d216..ed0699c0fe 100644
--- a/hertzbeat-collector/hertzbeat-collector-collector/pom.xml
+++ b/hertzbeat-collector/hertzbeat-collector-collector/pom.xml
@@ -132,6 +132,32 @@
 
     <build>
         <finalName>apache-hertzbeat-collector-${hzb.version}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <version>${maven-jar-plugin.version}</version>
+                <configuration>
+                    <classesDirectory>target/classes/</classesDirectory>
+                    <archive>
+                        <!--Generated JAR does not include Maven 
descriptor-related files-->
+                        <addMavenDescriptor>false</addMavenDescriptor>
+                        <manifest>
+                            <!--Project startup class-->
+                            
<mainClass>org.apache.hertzbeat.collector.Collector</mainClass>
+                            <useUniqueVersions>false</useUniqueVersions>
+                            <!--Third-party JARs are added to the classpath 
using maven-dependency-plugin-->
+                            <addClasspath>true</addClasspath>
+                            <!--Location of external dependency JARs-->
+                            <classpathPrefix>lib/</classpathPrefix>
+                        </manifest>
+                        <manifestEntries>
+                            <Class-Path>. config</Class-Path>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
     </build>
 
     <profiles>
@@ -181,30 +207,6 @@
                             <target>${java.version}</target>
                         </configuration>
                     </plugin>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-jar-plugin</artifactId>
-                        <version>${maven-jar-plugin.version}</version>
-                        <configuration>
-                            
<classesDirectory>target/classes/</classesDirectory>
-                            <archive>
-                                <!--Generated JAR does not include Maven 
descriptor-related files-->
-                                <addMavenDescriptor>false</addMavenDescriptor>
-                                <manifest>
-                                    <!--Project startup class-->
-                                    
<mainClass>org.apache.hertzbeat.collector.Collector</mainClass>
-                                    
<useUniqueVersions>false</useUniqueVersions>
-                                    <!--Third-party JARs are added to the 
classpath using maven-dependency-plugin-->
-                                    <addClasspath>true</addClasspath>
-                                    <!--Location of external dependency JARs-->
-                                    <classpathPrefix>lib/</classpathPrefix>
-                                </manifest>
-                                <manifestEntries>
-                                    <Class-Path>. config</Class-Path>
-                                </manifestEntries>
-                            </archive>
-                        </configuration>
-                    </plugin>
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-assembly-plugin</artifactId>
@@ -255,30 +257,6 @@
                             <target>${java.version}</target>
                         </configuration>
                     </plugin>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-jar-plugin</artifactId>
-                        <version>${maven-jar-plugin.version}</version>
-                        <configuration>
-                            
<classesDirectory>target/classes/</classesDirectory>
-                            <archive>
-                                <!--Generated JAR does not include Maven 
descriptor-related files-->
-                                <addMavenDescriptor>false</addMavenDescriptor>
-                                <manifest>
-                                    <!--Project startup class-->
-                                    
<mainClass>org.apache.hertzbeat.collector.Collector</mainClass>
-                                    
<useUniqueVersions>false</useUniqueVersions>
-                                    <!--Third-party JARs are added to the 
classpath using maven-dependency-plugin-->
-                                    <addClasspath>true</addClasspath>
-                                    <!--Location of external dependency JARs-->
-                                    <classpathPrefix>lib/</classpathPrefix>
-                                </manifest>
-                                <manifestEntries>
-                                    <Class-Path>. config</Class-Path>
-                                </manifestEntries>
-                            </archive>
-                        </configuration>
-                    </plugin>
                     <plugin>
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-assembly-plugin</artifactId>
diff --git a/script/assembly/collector/bin/entrypoint.sh 
b/script/assembly/collector/bin/entrypoint.sh
index b4052e64a7..eebe3dddcb 100644
--- a/script/assembly/collector/bin/entrypoint.sh
+++ b/script/assembly/collector/bin/entrypoint.sh
@@ -35,7 +35,8 @@ DEPLOY_DIR=`pwd`
 CONF_DIR=$DEPLOY_DIR/config
 MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
 EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+LIB_PATH="$DEPLOY_DIR/lib"
+CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$LIB_PATH/*:$EXT_LIB_PATH/*"
 # log dir
 LOGS_DIR=$DEPLOY_DIR/logs
 # create logs dir when not exist
diff --git a/script/assembly/collector/bin/startup.bat 
b/script/assembly/collector/bin/startup.bat
index 2b4cd73dc1..5d58d35a6c 100644
--- a/script/assembly/collector/bin/startup.bat
+++ b/script/assembly/collector/bin/startup.bat
@@ -44,7 +44,8 @@ for /f "tokens=1-5" %%i in ('netstat -ano^|findstr 
"0.0.0.0:%SERVER_PORT%"') do
 set MAIN_CLASS=org.apache.hertzbeat.collector.Collector
 set LOGS_DIR=%DEPLOY_DIR%\logs
 set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
-set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
+set LIB_PATH=%DEPLOY_DIR%\lib
+set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%LIB_PATH%\*;%EXT_LIB_PATH%\*
 
 if not exist %LOGS_DIR% (
     mkdir %LOGS_DIR%
diff --git a/script/assembly/collector/bin/startup.sh 
b/script/assembly/collector/bin/startup.sh
index dbdab8c581..d21138a856 100644
--- a/script/assembly/collector/bin/startup.sh
+++ b/script/assembly/collector/bin/startup.sh
@@ -73,7 +73,8 @@ if [ -n "$SERVER_PORT" ]; then
 fi
 MAIN_CLASS="org.apache.hertzbeat.collector.Collector"
 EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+LIB_PATH="$DEPLOY_DIR/lib"
+CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$LIB_PATH/*:$EXT_LIB_PATH/*"
 # log dir
 LOGS_DIR=$DEPLOY_DIR/logs
 # create logs dir when not exist
diff --git a/script/assembly/server/bin/entrypoint.sh 
b/script/assembly/server/bin/entrypoint.sh
index 7513083dd9..651eec2cce 100644
--- a/script/assembly/server/bin/entrypoint.sh
+++ b/script/assembly/server/bin/entrypoint.sh
@@ -37,7 +37,8 @@ DEPLOY_DIR=`pwd`
 CONF_DIR=$DEPLOY_DIR/config
 MAIN_CLASS="org.apache.hertzbeat.startup.HertzBeatApplication"
 EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+LIB_PATH="$DEPLOY_DIR/lib"
+CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$LIB_PATH/*:$EXT_LIB_PATH/*"
 # log dir
 LOGS_DIR=$DEPLOY_DIR/logs
 # create logs dir when not exist
diff --git a/script/assembly/server/bin/startup.bat 
b/script/assembly/server/bin/startup.bat
index 2d5dfd6dc3..4f3c60aba0 100644
--- a/script/assembly/server/bin/startup.bat
+++ b/script/assembly/server/bin/startup.bat
@@ -44,7 +44,8 @@ for /f "tokens=1-5" %%i in ('netstat -ano^|findstr 
"0.0.0.0:%SERVER_PORT%"') do
 set MAIN_CLASS=org.apache.hertzbeat.startup.HertzBeatApplication
 set LOGS_DIR=%DEPLOY_DIR%\logs
 set EXT_LIB_PATH=%DEPLOY_DIR%\ext-lib
-set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%EXT_LIB_PATH%\*
+set LIB_PATH=%DEPLOY_DIR%\lib
+set CLASSPATH=%DEPLOY_DIR%\%JAR_NAME%;%LIB_PATH%\*;%EXT_LIB_PATH%\*
 
 if not exist %LOGS_DIR% (
     mkdir %LOGS_DIR%
diff --git a/script/assembly/server/bin/startup.sh 
b/script/assembly/server/bin/startup.sh
index 45bff0dc90..873a4c1fde 100644
--- a/script/assembly/server/bin/startup.sh
+++ b/script/assembly/server/bin/startup.sh
@@ -75,7 +75,8 @@ if [ -n "$SERVER_PORT" ]; then
 fi
 MAIN_CLASS="org.apache.hertzbeat.startup.HertzBeatApplication"
 EXT_LIB_PATH="$DEPLOY_DIR/ext-lib"
-CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$EXT_LIB_PATH/*"
+LIB_PATH="$DEPLOY_DIR/lib"
+CLASSPATH="$DEPLOY_DIR/$JAR_NAME:$LIB_PATH/*:$EXT_LIB_PATH/*"
 # log dir
 LOGS_DIR=$DEPLOY_DIR/logs
 # create logs dir when not exist


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to