I have in my project a lot of unit tests, written in JUnit and TestNG. The building process is based on maven with surefire plugin.
Is there any way/plugin for maven to
Have you tried specifying the timeout for the test through @Test(timeout=xx)? Find the official api documentation here: http://junit.sourceforge.net/javadoc/org/junit/Test.html
EDIT---
You can also consider using the timeout property for the TestNg suite, you will have to move all your tests to TestNg though, but this will allow you to specify timeouts for groups.
This is the official api documentation: http://testng.org/javadoc/org/testng/xml/XmlSuite.html#setTimeOut(java.lang.String)