It seems that for some reason my thor script always returns with 1. I put these properties to Maven Exec plugin's configuration and now the build goes through without errors.
<successCodes>
<successCode>0</successCode>
<successCode>1</successCode>
</successCodes>