JavaExec and module-path expansion

Hi!

I try to mimic the auto class-path expansion that JavaExec does for ‘classpath’ file collection. Extending “JavaExec” seems not enough, as the underlying handle builder is used to gather the “all jvm” arguments.

See https://github.com/junit-team/junit5/commit/00f46fb5f955ab33352d28267887a22b6ddc7886#diff-23c39b2f7b5e0b042837cc226c2613af for a simple pitch, which suffers from the issue described above: when the task gets executed, the overriden method is not queried by the handle builder.

How do I setup such a feature correctly?

Or is it better to let the end-user provide the module-path as done in: