Greetings,
I too have a build process that requires building many standalone
projects. Prior to trying the optional foreach task, I am trying to get
the build to work using execon. Essentially, I am trying to cascade the
target to build.xml in the next level subdirectory. However, I get an
IOException in CreateProcess.
Here is a snippet from the top level build file:
<target name="abc" >
<execon executable="ant" >
<arg value="-buildfile"/>
<srcfile/>
<arg value="abc"/>
<fileset dir=".">
<patternset>
<include name="*/build.xml"/>
</patternset>
</fileset>
</execon>
</target>
Here is the error message:
D:\projects>ant abc -verbose
Ant version 1.3 compiled on June 8 2001
Buildfile: build.xml
Detected Java Version: 1.3
Detected OS: Windows 2000
parsing buildfile D:\projects\build.xml with URI =
file:D:/projects/build.xml
Project base dir set to: D:\projects
[property] Loading D:\projects\.ant.properties
[property] Unable to find D:\projects\.ant.properties
[property] Loading C:\Documents and Settings\dnesbitt\.ant.properties
Build sequence for target `abc' is [abc]
abc:
[execon] Myos = Windows 2000
[execon] ant -buildfile abc
[execon] Executing ant -buildfile D:\projects\MyProject\build.xml abc
BUILD FAILED
D:\projects\build.xml:61: Execute failed: java.io.IOException:
CreateProcess: ant -buildfile D:\projects\MyProject\build.xml abc
error=2
--- Nested Exception ---
java.io.IOException: CreateProcess: ant -buildfile
D:\projects\MyProject\build.xml abc error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:551)
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Exec
ute.java:509)
at
org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:329)
at
org.apache.tools.ant.taskdefs.ExecuteOn.runExec(ExecuteOn.java:167)
at
org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:162)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.Project.executeTargets(Project.java:510)
at org.apache.tools.ant.Main.runBuild(Main.java:421)
at org.apache.tools.ant.Main.main(Main.java:149)
Total time: 1 second
Thanks in advance for any suggestions!
Regards,
Dave