This technique fails because JUnit attempts to load the classes defined as categories. Since the definition of surefire is in the top-level POM, these classes (which I had defined in core.testsupport) do not exist.
A quick search on google shows others hitting the same issue, eg https://github.com/KentBeck/junit/issues/400.
So instead, am using a naming convention:
- by default, exclude all IntegrationTest classes
- if specify -P integtest-mongo, then run only the Mongo*IntegrationTest classes
- if specify -P integtest-sql, then run only the Sql*IntegrationTest classes
I haven't yet figured out a way to be able to run both the mongo and sql integration tests in a single run.