Proposal for Exec Package 28th July 2005 Rationale ------------------------------------ Executing external processes from Java is a well-known problem area. It is inheriently platform dependent and requires the developer to know and test for platform specific behaviors, for example using cmd.exe on Windows or limited buffer sizes causing deadlocks. The JRE support for this is very limited, albeit better with the new Java SE 1.5 ProcessBuilder class. Reliably executing external processes can also require knowledge of the environment variables before or after the command is executed. In J2SE 1.1-1.4 there is not support for this, since the method, System.getenv(), for retriving environment variables is deprecated (in later releases the deprecation was removed). The are currently several different libraries that for their own purposes has implemented frameworks around Runtime.exec() to handle the various issue outlined above. The proposed project should aim at coordinating and learning from these initatives to create and maintain a simple, reusable and well-tested package. Since some of the more problematic platforms are not readily available, it is my hope that the broad Apache community can be a great help. Scope of the package ------------------------------------ The package shall create and maintain a process execution package written in the Java language to be distributed under the ASF license. The Java code might also be complemented with scripts (e.g. Perl scripts) to fully enable execution on some operating systems. The package should aim for supporting a wide range of operating systems while still having a consistent API for all platforms. Identify the initial source for the package ------------------------------------ Several implementations exists and should be researched before finalizing the design: * Ant 1.X contains probably the most mature code within the exec task. This code has been stripped of the Ant specifics and cleaned up by Niklas Gustavsson and can be donated under the ASF license. * Ideas from http://ant.apache.org/ant2/actionlist.html#exec * plexus-utils has a similar but slimmer BSD-licensed implementation than Ant that can be reused Identify the base name for the package ------------------------------------ org.apache.commons.exec INITIAL COMMITTERS ------------------------------------ Brett Porter Stefan Bodewig Trygve Laugstol INITIAL CONTRIBUTORS ------------------------------------ Niklas Gustavsson Kev Jackson