ailiujiarui commented on code in PR #16542:
URL:
https://github.com/apache/dolphinscheduler/pull/16542#discussion_r1811609498
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-java/src/main/java/org/apache/dolphinscheduler/plugin/task/java/JavaTask.java:
##########
@@ -150,43 +132,48 @@ public void handle(TaskCallBack taskCallBack) throws
TaskException {
}
/**
- * Construct a shell command for the java Run mode
+ * Construct a shell command for the java -jar Run mode
*
* @return String
- * @throws Exception
**/
- protected String buildJavaCommand() throws Exception {
+ protected String buildJarCommand() {
+ ResourceContext resourceContext = taskRequest.getResourceContext();
+ String mainJarAbsolutePathInLocal = resourceContext
+ .getResourceItem(javaParameters.getMainJar().getResourceName())
+ .getResourceAbsolutePathInLocal();
StringBuilder builder = new StringBuilder();
- String sourceCode = buildJavaSourceContent();
- builder.append(buildJavaCompileCommand(sourceCode))
- .append(";")
- .append(getJavaCommandPath())
+ builder.append(getJavaCommandPath())
.append("java").append(" ")
- .append(buildResourcePath())
- .append(" ")
- .append(getPublicClassName(sourceCode))
- .append(" ")
+ .append(buildResourcePath()).append(" ")
+ .append("-jar").append(" ")
+ .append(mainJarAbsolutePathInLocal).append(" ")
Review Comment:
Updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]