3

I'm using the following code:

List<String> command = new ArrayList<String>();
command.add(antExecutable);
command.add("test");

ProcessBuilder processBuilder = new ProcessBuilder(command);
processBuilder.directory(new File("C:\\Testing\\projects...myPath..."));

Process process = processBuilder.start();

And the question is: How can i get the build-status? Is it failed or not..?

TT.
  • 15,774
  • 6
  • 47
  • 88
Sergey Zim
  • 143
  • 1
  • 5

1 Answers1

0

Your only choice in this case to depend on exit code. By convention, it must be 0 for success and non zero for failures.

Having said that, your case could be improved by running ant directly in your Java application. See a discussion in SO question Running ANT Programmatically Through Java from a quick google search result such as IBM Developerworks

Community
  • 1
  • 1
Jayan
  • 18,003
  • 15
  • 89
  • 143