Skip to content
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

Use of exec-maven-plugin:exec:java with System.exit() kills build silently #4458

Closed
tsmaeder opened this issue Mar 17, 2017 · 6 comments · Fixed by #4762
Closed

Use of exec-maven-plugin:exec:java with System.exit() kills build silently #4458

tsmaeder opened this issue Mar 17, 2017 · 6 comments · Fixed by #4762
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@tsmaeder
Copy link
Contributor

tsmaeder commented Mar 17, 2017

In many project, for example in /che/assembly/assembly-ide-war/pom.xml, we use the exec:java goal of the maven plugin "exec-maven-plugin".
In this particular instance, the maven plugin call org.eclipse.che.util.GwtXmlGenerator. This main class catches exceptions and call System.exit(1). Since the exec:java goal does not start a separate VM to execute the main class, this immediately terminates the maven process.
The problem is much worse when using the Eclipse IDE, since in that case, the System.exit() happens inside the process that runs the IDE. Basically, running an incremental build reilably terminates the IDE.
I see three options:

  1. Don't use the exec-maven plugin, but instead write mojos like DtoGeneratorMojo, for example
  2. Don't call System.exit(), but instead throw an exception. I would expect the exec:java goal to catch excptions and handle them properly.
  3. Use exec:exec instead of exec:java
@tsmaeder
Copy link
Contributor Author

This is a total blocker for me and anyone using Eclipse.

@davidfestal
Copy link
Contributor

davidfestal commented Mar 17, 2017

it happens I had this quite a few times also.

@skabashnyuk
Copy link
Contributor

Will be fixed by #4373

@tsmaeder
Copy link
Contributor Author

True for the GwtXmlGenerator, but there are other classes using System.exit() in Che.

@ghost ghost added the kind/question Questions that haven't been identified as being feature requests or bugs. label Mar 17, 2017
@sunix
Copy link
Contributor

sunix commented Apr 10, 2017

Any updates on this bug ? many Che developers are suffering from that ...

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Apr 10, 2017

No progress. If you can, please propose pr.

sunix added a commit to sunix/che that referenced this issue Apr 11, 2017
sunix added a commit to sunix/che that referenced this issue Apr 11, 2017
… jvm or IDE running them.

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>
sunix added a commit that referenced this issue Apr 11, 2017
… running them.

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>
sunix added a commit that referenced this issue Apr 12, 2017
… running them.

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>
sunix added a commit to sunix/che that referenced this issue May 4, 2017
… jvm or IDE running them.

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>
JPinkney pushed a commit to JPinkney/che that referenced this issue Aug 17, 2017
… jvm or IDE running them.

Signed-off-by: Sun Seng David Tan <sutan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants