Here is my java code:
public void execInstall() {
ProcessBuilder pb = new ProcessBuilder("mvnd install").inheritIO();
Process process = pb.start();
process.waitFor();
if (process.exitValue() == 0) {
// This means suceed
} else {
// This means some error occured
}
}
But this haven't act as what I want.When something wrong occurs with the "mvnd install", I didn't get a non-zero value from the process.exitValue().
When I change the mvnd to mvn, it just act as I want.
Help me plz.