-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed The jar type of java task shell script error #15645
Conversation
Thanks for your first contribution. Can you update the PR title in English? by the way, please add a Unit Test. |
Could you raise an issue and discribe the bug, thanks. |
you can read from :#15641 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run 'mvn spotless:apply' to fix the code style @yangyanh
@@ -183,9 +184,8 @@ protected String buildJarCommand() { | |||
StringBuilder builder = new StringBuilder(); | |||
builder.append(getJavaCommandPath()) | |||
.append("java").append(" ") | |||
.append(buildResourcePath()).append(" ") | |||
.append(buildExtDirs()).append(" ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor this, use -cp
rather than -jar
.
$JAVA_HOME/bin/java $JVM_ARGS \
-cp "$taskInstanceWorkingPath" \
Main.class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use -jar, you need to specify the entry class, but the page cannot specify the entry class on the configuration page when you select the jar type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,I just find we cannot set entry class......
So we only support fat jar, this is sad.
So the final command should look like
$JAVA_HOME/bin/java -jar xx.jar $JVM_ARGS
Can we remove -Djava.ext.dirs
, it seems not a good idea to use this param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that -jar cannot work with -cp together,-jar cannot get -cp's libraries,Is your shell worked success?have you test your shell script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use -cp, you need to specify the entry class, but the page cannot specify the entry class on the configuration page when you select the jar type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that -jar cannot work with -cp together,-jar cannot get -cp's libraries,Is your shell worked success?have you test your shell script?
Yes, -jar can not work with -cp.
Once we use -jar then the jar should be a fat jar, the better way is to add ext jar by set Class-Path at MANIFEST.MF
.
So Can we add entry class in UI and use -cp to refactor this.
This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs. |
This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request. |
Purpose of the pull request
fix #15641
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md