Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven both include and exclude patterns to run tests from command line

With -Dtest=<include-pattern> I can include tests that match include-pattern, and with -Dtest=!exclude-pattern I can exclude tests that match exclude-pattern.
How can I use both include and exclude patterns in command line option?

Next is not working for me: -Dtest=<include-pattern>,!<exclude-pattern>

If I use -Dincludes=**/<include-pattern> -Dexcludes=**/<exclude-pattern> exclude-pattern seem to be applied only.

Is there any way I can configure both include/exclude patterns from command line?

like image 594
Mike Avatar asked Dec 06 '25 03:12

Mike


1 Answers

Try to use quoting while passing comma separated values (e.g. -Dtest="<include-pattern>,!<exclude-pattern>"). This works for me and this is how it's planned to work.

like image 156
nickolay.laptev Avatar answered Dec 07 '25 19:12

nickolay.laptev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!