I'm using the Weblogic Mojo in one of my Maven scripts.  I've noticed
that some of the goals (undeploy and redeploy so far) actually call
System.exit() and therefore stop Maven from return with a "Successful
Build".  Has anyone else noticed this?

I did some digging and looks like it's the Weblogic code
(somewhere in weblogic.Deployer) that is doing this.  Because my
scripts are used in Continuum, I couldn't have the plugin shutting down
maven unexpectedly, so I wrote some code to prevent the call to
System.exit(), which I've attached.  In the Mojo, the code can look
something like below:


            // Get original manager and store
            SecurityManager realManager = System.getSecurityManager();

            // Set new Mojo Security Manager as the 
            // current manager

            System.setSecurityManager(new MojoSecurityManager());

            // Deploy with the parameters
            Deployer deployer = new Deployer( parameters );
            try
            {

                deployer.run();
            }
            catch(SecurityException e)
            {
                getLog().debug("Security Exception (expected)");
            }
            finally

            {
                // Replace the security manager with the 
                // old one (usually null, I think)
                System.setSecurityManager(realManager);
            }

Hope that's helpful!!


Paolo

 




      
____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 





      
____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel 
and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

Attachment: MojoSecurityManager.java
Description: Binary data

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to