-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Failures in -Djarmode=tools do not consistently return a non zero exit #43432
Conversation
c128183
to
2e9c66b
Compare
Hello! I see that there's a issue to fix. Ideally the CLI should return code 1 in every error case. Thanks for the PR, but I don't like that approach. Putting a Do you want to implement that in this PR or should I file a new issue tracking this? |
@mhalbritter thanks for feedback, I will give this a shot in this PR a little later |
@mhalbritter I have pushed some modifications. Does this look (a bit) at what you were expecting ? Also, i can't catch |
Thanks for the updated PR @mpalourdio. Looking in more detail I think we should pull up our exiting error reporting logic to a central location. That ends up being quite a large change and something we'll need to apply in 3.3 so I'm going to take care of it in #43435. Thanks for reporting the problem and for your PR. |
Hello,
we are dealing with multiple Spring boot versions in our CI.
As we want to leverage jar extraction and CDS, we need to deal with multiple scenarios :
Unsupported jarmode 'tools'
. See hereXXXX.jar is not compatible; ensure jar file is valid and launch script is not enabled
but when ran from CLI, the exit code is0
, although an exception is thrown.3.
is painful, because you need to catch the STD output to check and grep for an error. Something like this pseudo bashThis PR handles
3
by moving the exception to a system exit code, which seems to be more in line with this feature which is mostly intended to run as CLI and could lead to cleaner error handling, iejava -Djarmode=tools -jar /opt/my.jar extract --destination /opt/extracted || whatever_you_want_to_do