You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/09/21 14:17:17 UTC

[jira] Updated: (MAVEN-784) Add "embedded mode" execution support for avoiding System.exit()

The following issue has been updated:

    Updater: Brett Porter (mailto:brett@codehaus.org)
       Date: Tue, 21 Sep 2004 8:15 AM
    Changes:
             Fix Version changed to 1.1
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/browse/MAVEN-784?page=history

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MAVEN-784

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MAVEN-784
    Summary: Add "embedded mode" execution support for avoiding System.exit()
       Type: New Feature

     Status: Unassigned
   Priority: Major

 Original Estimate: 30 minutes
 Time Spent: Unknown
  Remaining: 30 minutes

    Project: maven
 Components: 
             core
   Fix Fors:
             1.1
   Versions:
             1.0-rc1

   Assignee: 
   Reporter: John Casey

    Created: Thu, 4 Sep 2003 11:00 PM
    Updated: Tue, 21 Sep 2004 8:15 AM
Environment: any platform, executed from within a pre-existing JVM

Description:
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.


---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report 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