newrealtest0000
newrealtest0000

Reputation: 35

Run maven tests in a DOS batch file

I am new to scripting. Basically I want to run maven tests and then execute other commands once they're finished (e.g. Write a message to a file, or email the results to myself, etc. For simplicity, let's say I just want to write DONE to "C:/results" file in this case). This is the script that I have:

    mvn test
    echo "DONE" > C:/results

The problem is, the second line (echo) never executes, because first one (mvn test) never seems to finish, even though I can see from the output that running the test finished. How can I change the script to execute the rest of the commands once execution of first line (mvn test) finishes?

Upvotes: 1

Views: 839

Answers (1)

khmarbaise
khmarbaise

Reputation: 97457

If you are on windows you have to be aware that mvn itself is .bat file which means you have to do the following: call mvn test

You need to do the call... cause the mvn.bat is running and ended at the end of mvn.bat. This is the way it is in Windows.

Upvotes: 1

Related Questions