0

Scenario: Multi-module Maven project

Issue: Unit tests are only running for a single module.

Background: I'm attempting to separate my integration testing from unit testing. To do this I've created two properties in my parent pom, Root-module, that disable unit tests and integration tests by default.

<maven.test.skip>true</maven.test.skip>
<maven.integration.test.skip>true</maven.integration.test.skip>

In my top-most module, UI-module, I've created two profiles, dev and integration-test. Dev has unit tests enabled and integration-test has integrations enabled:

<profile>
....
<maven.test.skip>false</maven.test.skip>
</profile>

Integration-test works correctly. The dev profile only runs the unit-tests for the UI-module, which is where the pom.xml is located that contains these profiles.

How can I enable unit tests for all modules? Is the profile approach correct? If so, why isn't the value applied to other modules?

fakataha
  • 785
  • 6
  • 31
  • See [this answer](http://stackoverflow.com/a/18874421/944849). You likely need to include the same profile, with the same activation block, in the module POMs you want to inherit the config. – user944849 Mar 24 '17 at 01:20
  • I was afraid that might be the case and that makes me sad. – fakataha Mar 24 '17 at 01:22
  • Me too. I spent the better part of day a while back trying to make this work before finally figuring out that the inheritance isn't there. – user944849 Mar 24 '17 at 01:26

0 Answers0