JUnit5 tag-specific gradle task
<p>I use the following annotation to tag my integration tests:</p>

<pre class="lang-java prettyprint-override"><code>@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Tag("integration-test")
public @interface IntegrationTest {
}
</code></pre>

<p>This is the filter I use in <code>build.gradle</code> to exclude these tests from <code>gradle build</code>:</p>

<pre class="lang-groovy prettyprint-override"><code>junitPlatform {
    filters {
        tags {
            exclude 'integration-test'
        }
    }
}
</code></pre>

<p>So far, so good.</p>

<p>Now I would like to offer a Gradle task which specifically runs my integration tests – what's the recommended approach?</p>