Under Eclipse, use the Clover Eclipse Plugin.
Under Maven, use the Maven Clover Plugin. Add a Clover Report to the site generation:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<configuration>
[...]
</configuration>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
<reporting>
<plugins>
[...]
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<configuration>
[...]
</configuration>
</plugin>
</plugins>
</reporting>
[...]
Optionally, you can check for a test coverage percentage and fail the build in case of non-compliance:
<build>
<plugins>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<configuration>
<targetPercentage>80%</targetPercentage>
</configuration>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>instrument</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
The maven build remains the master. Run it using your preferred method (command line or m2eclipse).