Eclipse, Maven and code coverage

Is there any Eclipse plug-in that provides code coverage directly in the Eclipse JAVA editor, like eCobertura or EclEmma , but runs tests using the Maven test target (i.e. mvn test )?

I need to specify a Maven profile to filter some properties (i.e. mvn -Pdev test ), but the two solutions above do not allow us to work with Maven (AFAIK).

PS: I know that I could use the clean site Maven targets (i.e. mvn -Pdev clean site ) or the Cobertura Maven plugin (i.e. mvn -Pdev cobertura:cobertura ) to get a code coverage report, but I I would like to get coverage directly inside the Eclipse JAVA editor. Convenience addict.

+4
source share
1 answer

Can you set the default maven profiles for your project using Project Properties -> Maven -> Active Maven Profiles?

(Also: I would not have a special β€œtest” profile if that means that tests cannot run without it. It's too easy to forget to run tests. β€œDev” makes sense, but probably should be active by default. Otherwise case, new developers will fight to create a project.)

+3
source

Source: https://habr.com/ru/post/1436164/


All Articles