What is the difference between maven-failsafe-plugin and maven-surefire-plugin?

maven-surefire-plugin is designed for running unit tests and if any of the tests fail then it will fail the build immediately.

maven-failsafe-plugin is designed for running integration tests, and decouples failing the build if there are test failures from actually running the tests.

How can I reuse my test code in other modules?

Visit this link for your reference, | Attaching tests

How can I run GWT tests ? There is a specific gwt-maven-plugin at codehaus, but if you want to run with surefire, you need the following settings:

Use the following configuration:
true]]>
false]]>
once]]>
forkMode at least once, always if not enough