Search code examples
junitantjunit5ant-junit

How to execute JUnit 5 @Tag tests with Ant?


How do I use Ant to run a JUnit 5 test annotated with @Tag?

For instance:

class Tax {
    @Test
    @Tag("taxes")
    void testingTax() {
    }
}

In Maven, I can do the following to either include or exclude. However I don't know how to make it work in Ant.

<properties>
    <includeTags>taxes</includeTags>
    <excludeTags>Promo</excludeTags>
</properties>

Kindly advise.


Solution

  • According to Apache Ant developers JUnit5 is currently not supported. However, according to this bug report, they have started working. There is also a message about this topic here.