I am trying to automate my maven build and deployment process of the EAR in Jboss. I managed to write a bat file for the same which is given below.
ECHO OFF
RMDIR /S /Q .\deploy
call mvn clean install -D build=P,JB
call mvn clean install -D build=F,JB
@echo | call C:\Work\jboss-as-7.1.1.Final\bin\jboss-cli.bat --connect --controller=[my-machine-name]:9999 command=:shutdown
del /q C:\Work\jboss-as-7.1.1.Final\standalone\deployments\*.*
xcopy /s /y .\deploy\function\Jboss\*.ear C:\Work\jboss-as-7.1.1.Final\standalone\deployments
xcopy /s /y .\deploy\WorkFlowEngine\Jboss\*.ear C:\Work\jboss-as-7.1.1.Final\standalone\deployments
cd C:\Work\jboss-as-7.1.1.Final\bin
rmdir "C:\work\jboss-as-7.1.1.Final\standalone\data" /s /q
rmdir "C:\work\jboss-as-7.1.1.Final\standalone\log" /s /q
rmdir "C:\work\jboss-as-7.1.1.Final\standalone\tmp" /s /q
standalone.bat -bmanagement [my-machine-name] -b [my-machine-name] -c standalone-full-ha.xml
{code for check of deployment success/failure}
PAUSE
Here you can see that I am using the line
standalone.bat -bmanagement sbstjwsvm1509 -b sbstjwsvm1509 -c standalone-full-ha.xml
My requirement is that I want to check if the EAR was deployed successfully from my bat file.One way which I thought of is to check for .deplyed or .failed extension files in the Jboss deployment folder.I tried to write codes for the same but my code which is written below the above mentioned line is not getting executed.Is there any other means by which I can achieve this?Or what am I doing wrong in my bat file?Why is my code to check for deployment not getting executed?