ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Bengl <Mar...@Bengl.de>
Subject Re: AntLauncher: avoid exiting VM!
Date Sat, 01 Jul 2006 11:33:28 GMT
thanks for your reply.

the manual (http://ant.apache.org/manual/running.html#viajava) describes 
the use of Main or Launcher.
But the System.exit would caused by both ways :-/

but i found a manual ("Invoking Apache Ant programmatically") at ibm - 
thanks to you jeffrey :-)
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0502_gawor/0502_gawor.html

i will try this.



Jeffrey E Care schrieb:
>
> AFAIK the Launcher is not intended to be used in the manner you are 
> using it. Please check the manual for instructions on how to use Ant 
> programmatically.
> ____________________________________________________________________________________________

>
> Jeffrey E. (Jeff) Care 	
> _carej@us.ibm.com_ <mailto:carej@us.ibm.com>
> IBM WebSphere Application Server Development 	
> WAS Pyxis Lead Release Engineer
> WebSphere Mosiac 	
> WebSphere Brandmark
>
>
>
>
> Martin Bengl <Martin@Bengl.de> wrote on 07/01/2006 06:56:24 AM:
>
> > Hi Folks,
> >
> > I'm using the AntLauncher to start ant out of a java environment. after
> > running the ant script the vm should not quits!
> > The class org.apache.tools.ant.launch.Launcher has a member called
> > MAIN_CLASS with the value** "org.apache.tools.ant.Main" **.
> > This class has a exit method which calls System.exit. the exit 
> method is
> > protected - so its possible to extend the class and overwrite the exit
> > method.
> > the problem: the member MAIN_CLASS of the Launcher class is final 
> static
> > - it is not possible to change the value programmaticly.
> > could you change this?
> >
> > static getter and setter would be fine:
> >
> > public static String mainClassName = MAIN_CLASS;
> >
> > public static void setMainClassName(String newMainClass)
> > {
> >   mainClassName = newMainClassName;
> > }
> >
> > using in method run(..) without exception handling:
> >
> > Class mainClass = loader.loadClass(mainClassName);
> >
> >
> > cheers
> > martin
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail: dev-help@ant.apache.org
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message