ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47854] New: Ant can't run within another Java program
Date Wed, 16 Sep 2009 21:46:03 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47854

           Summary: Ant can't run within another Java program
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: bugzilla@byrden.com


My current shell is XMLSH, a Java program that loads Ant into its own VM. But I
had to modify 2 classes to make this work. Ant 1.7.1 is an ill-behaved guest in
the VM Because:

[1] It calls System.exit() which kills the entire VM. 
[2] It makes an unwarranted assumption about its ClassLoaders

Re [1] : there are calls to System.exit() in both the Launcher class and the
Main class. I can extend Main to change this, but not Launcher.

In my opinion (I have Java programmer certification) no Java program should
need to kill the VM unless something is wrong. 

Re [2] : on loading Ant, I see this:
"org.apache.tools.ant.Main cannot be cast to
org.apache.tools.ant.launch.AntMain"

Reason: the Launcher class makes 2 ClassLoaders and assumes they will connect
up in a parent-child relationship. For me, they don't. I can see no reason why
Launcher should not make that connection explicitly.

Note: after changing these 2 classes, I am able to run Ant under XMLSH with a
very simple wrapper script.

David

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message