Start module tests earlier, before its dependencies tested (--parallel)

Hello,

I’m trying to optimise build time in a multi-module java build using the --parallel switch.

Module B depends on module A.

Both modules have their own jUnit tests, and currently tests in B cannot start before tests in A completed.

Is it possible to start the tests in B earlier, i.e. as soon as jar A is ready?

So that tests from both modules could run in parallel.

Thank you

What I did so far is extracted all tests from module A into a new module C that depends on A.

Now A will be built before tests in B start, but then tests in B and tests in C will run in parallel.

Looks like a dirty workaround that encourages creating extra modules without purpose.

Am I missing something here?