Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 73830 invoked from network); 22 Mar 2002 16:10:59 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 22 Mar 2002 16:10:59 -0000 Received: (qmail 5574 invoked by uid 97); 22 Mar 2002 16:10:49 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 5558 invoked by uid 97); 22 Mar 2002 16:10:49 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 5547 invoked from network); 22 Mar 2002 16:10:48 -0000 Message-ID: <000401c1d1bc$2044a130$0c3628aa@ad.dstsystems.com> From: "Craig Minton" To: "Ant Users List" References: <69D0FD30-3DA7-11D6-9FCB-00039379521C@mac.com> Subject: Re: Ant Exiting? Date: Fri, 22 Mar 2002 10:10:46 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Try calling Ant build by using the Project class: String buildXmlFile = "build.xml"; File dir = new File( "E:/myproject" ); Project pj = new Project( ); pj.init( ); // Add the default listener // Check the createLogger() method in Main.java pj.addBuildListener( createLogger( ) ); try { File file = FileUtils.newFileUtils( ).resolveFile( dir, buildXmlFile ); buildXmlFile = file.getAbsolutePath(); pj.setBaseDir( dir ); pj.setUserProperty( "basedir" , dir.getAbsolutePath( ) ); // Set properties, if needed pj.setProperty( "user", user ); // Add your build listeners, if needed pj.addBuildListener( new MyBuildListener( ) ); File bldFile = new File ( buildXmlFile ); pj.setUserProperty( "ant.file" , buildXmlFile ); ProjectHelper.configureProject( pj, bldFile ); } catch ( BuildException be ) { be.printStackTrace( ); } pj.executeTarget( buildTarget ); -Craig ----- Original Message ----- From: To: Sent: Friday, March 22, 2002 9:13 AM Subject: Ant Exiting? > If I use Ant in another Java application and call it via the 'start' > method on > Main, if the build fails the JVM is closed, i.e. so is the calling > application. > > Is there any way to call Ant without having System.exit called to > signify the end of execution. > > -John K > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > -- To unsubscribe, e-mail: For additional commands, e-mail: