I need to run a java application, if its output is “Passed” then I will run mvn site command. I have gone through several forums and got to know this can be done using pre-site goal but how will i validate the “Passed” state. The Java Application is a command that is used to invoke a Python script. If it runs successfully then output is passed. If i run from Hudson I can put the command in Pre-Build Step. But How will I validate if the output is passed or failed. Please help
I need to run a java application, if its output is Passed then I
Share
From Jenkins’s ‘Execute Shell’ help:
So you should make the Java application return 0 if passed, and something else otherwise. You can use
System.exit(0)for that.If you have no control over the java application, you can use
tail -1 | grep Passedto see if the command had “Passed” in its final line.