You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2005/05/16 08:11:34 UTC
[jira] Closed: (MAVEN-784) Add "embedded mode" execution support for avoiding System.exit()
[ http://jira.codehaus.org/browse/MAVEN-784?page=all ]
Brett Porter closed MAVEN-784:
------------------------------
Fix Version: (was: 1.1-beta-1)
Resolution: Won't Fix
as dion said some time back, the proper solution is to embed the MavenSession class (Which should soon be possible based on m2's requirements).
> Add "embedded mode" execution support for avoiding System.exit()
> ----------------------------------------------------------------
>
> Key: MAVEN-784
> URL: http://jira.codehaus.org/browse/MAVEN-784
> Project: maven
> Type: New Feature
> Components: core
> Versions: 1.0-rc1
> Environment: any platform, executed from within a pre-existing JVM
> Reporter: John Casey
> Attachments: embedded-mode.patch
>
> Original Estimate: 30 minutes
> Remaining: 30 minutes
>
> Currently, when maven completes, it returns some error level, which allows users to adjust the behavior of their scripts accordingly (as in the case of cron jobs and such, I would imagine). It accomplishes this task by calling System.exit(status) with the appropriate status code for the exit state of maven. Typically, this is a _good_thing_.
> However, when maven is called from within a running JVM, the System.exit() calls must be parried with some sort of SecurityManager or such, in order to keep the maven completion from bringing down the entire JVM and larger application. Another way around this is to spawn a new JVM for each maven execution, but this is unacceptably high in overhead, especially given the execution delay typically experienced while maven works its magic behind the scenes.
> My proposal is simple: create an embedded mode for maven, wherein System.exit() calls are supressed.
> In a typical application plugin, maven should be called by invoking Forehead with the proper configuration. This avoids the duplication of complex classloader logic, and maintains a single point of maintenance for the maven bootstrap process. In order to create an embedded mode, all that need be done is to add an option to the CLI parsing, (-E), and a boolean member variable in App.java which denotes which execution mode we're running in. Then, in the exit(status) method of App.java, simply insert conditional logic to check the execution mode, and supress System.exit() in embedded mode. The rest of maven need not be touched in any way.
> I am attaching a patch to this issue, which incorporates my ideas in concrete code.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org