Hello maven users,

Is there a way to activate a profile based on plug-in being run? I'm trying
to find a workaround for issue present in both free open source code
coverage maven report options, cobertura and emma (if there are more, please
let me know). AFAIK, both, to produce report, run code instrumentalization,
execute test phase in lifecycle separate from default, and then generate
output. Problem is that test phase is so to speak hardcoded, so surefire
execution configured to run in integration-test phase doesn't get run and
coverage data will apear to be lower than what they actually are.

Typicaly I use TestNG for tests, and it's test groups feature, separating
tests in at least "unit", and "integration" and/or "functional" test groups.
Then I configure surefire to run "unit" tests in "test" phase, and all the
others in "integration-test" phase. If profile could be activated based on
plug-in being run, workaround would be to create a profile, activeted on
e.g. site plug-in being run, and in that profile surefire could be
configured to contain only one default execution on test phase but would
include all the tests.

IMO, best solution would be to have following (in cobertura case,
longstanding) issues fixed ( http://jira.codehaus.org/browse/MCOBERTURA-86 ,
http://jira.codehaus.org/browse/MOJO-1299 )

Regards,
Stevo.

Reply via email to