How to force java test execution?

I notice that if all tests passed on the previous run (and barring any changes to the source code), the test task is considered “UP-TO-DATE” and the test code is not run, even when I run it with “test.single”.

This behavior is pretty neat, but it would also be nice to be able to force a re-run of the tests without the up to date checking. Especially in the case of “test.single”, I would prefer it re-run the test.

Any way to do this? Thanks.

You can use ‘–rerun-tasks’ on the command line or ‘test.outputs.upToDateWhen { false }’ in the build script.

1 Like

Ah, nice. Thanks!