-
Notifications
You must be signed in to change notification settings - Fork 101
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
New option 'blockSystemExit' for 'java' mojo #389
Labels
Comments
kriegaex
added a commit
to kriegaex/exec-maven-plugin
that referenced
this issue
Nov 9, 2023
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
kriegaex
added a commit
to kriegaex/exec-maven-plugin
that referenced
this issue
Nov 9, 2023
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
kriegaex
added a commit
to kriegaex/exec-maven-plugin
that referenced
this issue
Nov 9, 2023
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
kriegaex
added a commit
to kriegaex/exec-maven-plugin
that referenced
this issue
Nov 10, 2023
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
kriegaex
added a commit
to kriegaex/exec-maven-plugin
that referenced
this issue
Nov 10, 2023
This new option enables users to stop programs called by 'exec:java' from calling System::exit, terminating not just the mojo but the whole Maven JVM. Closes mojohaus#389. Relates to mojohaus#388.
slawekjaranowski
pushed a commit
that referenced
this issue
Nov 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Relates to #388, specifically to #388 (comment).
If the code called by
exec:java
misbehaves and executesSystem.exit(int)
instead of simply returning when successful or throwing an exception in case of an error, it not only interrupts the execution of this mojo, but terminates the whole Maven JVM in the middle of a build. In order to not force users to switch to the forkingexec:exec
goal instead and enable them to stay within the comfort zone ofexec:java
, I am proposing a special security manager which blocksSystem.exit(int)
execution in favour ofSystem.exit(0)
was called in case of a successfuly execution,SystemExitException
with the exit code to handle error situations gracefully and without terminating the Maven JVM.@slawekjaranowski: As discussed, a corresponding PR for this issue is in the pipeline. I already have an implementation, I just need to write a couple of integration tests on top of it.
The text was updated successfully, but these errors were encountered: