Posting the answer that is discussed in the comments section of the question.
This solution worked for me! Thanks Andrew Logvinov
cleanupDaemonThreads = false
Something like this in the configuration tag
<configuration>
<mainClass>com.test.Startup</mainClass>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
</configuration>