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

benjobs pushed a commit to branch dev-2.1.4
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev-2.1.4 by this push:
     new 22e1f0c7c [Improve] maven build args check improvements
22e1f0c7c is described below

commit 22e1f0c7cea63d32b922ec724c0095d218c9142e
Author: benjobs <[email protected]>
AuthorDate: Thu Mar 21 22:20:03 2024 +0800

    [Improve] maven build args check improvements
---
 .../org/apache/streampark/console/core/entity/Project.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Project.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Project.java
index e292b058b..3f2491f15 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Project.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Project.java
@@ -218,15 +218,21 @@ public class Project implements Serializable {
     }
 
     StringBuilder cmdBuffer = new StringBuilder(mvn).append(" clean package 
-DskipTests ");
-
     if (StringUtils.isNotBlank(this.buildArgs)) {
+      this.buildArgs = this.buildArgs.trim();
+      if (this.buildArgs.contains("\n")) {
+        throw new IllegalArgumentException(
+            String.format(
+                "Illegal argument: newline character in maven build 
parameters: \"%s\"",
+                this.buildArgs));
+      }
       String args = getIllegalArgs(this.buildArgs);
       if (args != null) {
         throw new IllegalArgumentException(
             String.format(
                 "Illegal argument: \"%s\" in maven build parameters: %s", 
args, this.buildArgs));
       }
-      cmdBuffer.append(this.buildArgs.trim());
+      cmdBuffer.append(this.buildArgs);
     }
 
     String setting = 
InternalConfigHolder.get(CommonConfig.MAVEN_SETTINGS_PATH());

Reply via email to