This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev-2.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev-2.1.3 by this push:
new 2608deddd [Improve] clean distribution unzip files before startup
2608deddd is described below
commit 2608deddde6fb2da486e1ee8fe55bf413252061f
Author: benjobs <[email protected]>
AuthorDate: Thu Dec 14 22:34:10 2023 +0800
[Improve] clean distribution unzip files before startup
---
.mvn/wrapper/MavenWrapperHelper.java | 10 ++++++++--
.../src/main/assembly/bin/streampark.sh | 16 +++++++++++++---
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/.mvn/wrapper/MavenWrapperHelper.java
b/.mvn/wrapper/MavenWrapperHelper.java
index 5ef20d831..45e1a70f9 100644
--- a/.mvn/wrapper/MavenWrapperHelper.java
+++ b/.mvn/wrapper/MavenWrapperHelper.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -144,6 +143,14 @@ public final class MavenWrapperHelper {
}
break;
+ case "path_dist":
+ propertiesPath = actionArgs[0];
+ properties = new Properties();
+ properties.load(Files.newInputStream(new
File(propertiesPath).toPath()));
+ distribution = getLocalDistribution(properties);
+ String unzip =
distribution.getDistributionDir().toFile().getAbsolutePath();
+ System.out.println(unzip);
+ System.exit(0);
default:
System.out.println("Unknown action");
System.exit(2);
@@ -302,4 +309,3 @@ public final class MavenWrapperHelper {
}
}
}
-
diff --git
a/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
b/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
index 2087f686a..409a1c835 100755
---
a/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
+++
b/streampark-console/streampark-console-service/src/main/assembly/bin/streampark.sh
@@ -341,9 +341,19 @@ get_pid() {
}
ready() {
- local mavenWrapper="$APP_HOME/bin/.mvn/wrapper/MavenWrapperHelper.class"
- if [[ -f $mavenWrapper ]]; then
- rm -f $mavenWrapper >/dev/null 2>&1
+ javaSource="$APP_HOME/bin/.mvn/wrapper/MavenWrapperHelper.java"
+ javaClass="$APP_HOME/bin/.mvn/wrapper/MavenWrapperHelper.class"
+ wrapperProperties="$APP_HOME/bin/.mvn/wrapper/maven-wrapper.properties"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaSource=$(cygpath --path --windows "$javaSource")
+ javaClass=$(cygpath --path --windows "$javaClass")
+ fi
+ ("$JAVA_HOME/bin/javac" "$javaSource")
+ # get distribution unzip path
+ dist_path=`("$JAVA_HOME/bin/java" -cp "$APP_HOME/bin/.mvn/wrapper"
MavenWrapperHelper "path_dist" "$wrapperProperties")`
+ if [ $? -eq 0 ]; then
+ rm -f $dist_path > /dev/null 2>&1
fi
}