For multi-module Maven projects, specify the module using -pl
and execute the Maven command from the root project. For example:
mvn test -pl=service -Dtest=InventoryServiceTest
In my case, I was omitting -pl
and was seeing "No tests were executed!".