Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C601E908B for ; Tue, 12 Jun 2012 19:01:11 +0000 (UTC) Received: (qmail 26017 invoked by uid 500); 12 Jun 2012 19:01:11 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 25949 invoked by uid 500); 12 Jun 2012 19:01:10 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 25939 invoked by uid 99); 12 Jun 2012 19:01:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2012 19:01:10 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gruener.heinrich@googlemail.com designates 209.85.214.45 as permitted sender) Received: from [209.85.214.45] (HELO mail-bk0-f45.google.com) (209.85.214.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2012 19:01:04 +0000 Received: by bkwj10 with SMTP id j10so5260339bkw.4 for ; Tue, 12 Jun 2012 12:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=lTA85zRqg/iWLxDOdlT3tzjEY5u5ZxckAspnszVCIe0=; b=LgqSTOJzkKARViZ6avVvrMclYJsZqfotOxrHuP+kG6ZN0bmTzuvtAoRIbaxizHR6y1 7s5uwagVaeKOXo/zocnK72DeGbDAjWmRHw53sTzuWgjTpKpzWi+oQMUEAzX+MlWuRDKD KypRS0JWsK2oVP9uBp5Zm+vfb/hFjh7Y2PZkAqTqo3woVtckeapMtMMwe/kjW8MQIc8W 4BDp5IxylyTiNeIg5W5APGyb3RftzeqvF7xIJ0vrX3TFAvgKgFnYicaHuLa8Tjv/DdZ6 HDbLK8ZcgeNX314P/MhyBW3sx5Ta7ULO8t4Yvwi+t70IUfPc0V/4QVJR0CjbqgnI0HGX n0pA== Received: by 10.205.126.14 with SMTP id gu14mr12355527bkc.137.1339527643177; Tue, 12 Jun 2012 12:00:43 -0700 (PDT) Received: from [10.62.159.163] ([82.113.98.163]) by mx.google.com with ESMTPS id n19sm236896bkv.14.2012.06.12.12.00.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jun 2012 12:00:42 -0700 (PDT) Message-ID: <4FD791D3.7000309@googlemail.com> Date: Tue, 12 Jun 2012 21:00:35 +0200 From: =?ISO-8859-15?Q?Gr=FCner_Heinrich?= Reply-To: gruener.heinrich@web.de User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Ant Users List Subject: Starting Ant From Java Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi User List, I try to start an Ant Buildfile from Java. Unfortunately Ant is not able to load custom ant tasks, although I try to set the classloader for the thread. Here is the code snip I use. public static void startForNode(final AntRunnerNode ar,boolean wait) { Thread t=new Thread() { public void run() { try { Project project=new Project(); project.init(); project.setSystemProperties(); ProjectHelper.configureProject(project, ar.getBuildFile()); project.executeTarget(ar.getTargetName()); } catch (Exception e) { e.printStackTrace(); } } }; t.setContextClassLoader(Thread.currentThread().getContextClassLoader()); if (wait) { t.run(); } else { t.start(); } } Any help appreciated. Thanks, Stefan. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org