From 34f10211b4d8344fec8f99c40844d0ae188783ec Mon Sep 17 00:00:00 2001 From: Nicola Isotta Date: Mon, 12 Oct 2026 17:29:29 +0200 Subject: [PATCH] Maven: skip also integration test when the global "skip tests" option is enabled Starting with Surefire/Failsafe 3.6.0, skipTests only skips unit tests. Set the skipITs property alongside skipTests in TestChecker when test skipping is enabled to also skip integration test execution. --- .../org/netbeans/modules/maven/TestChecker.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/java/maven/src/org/netbeans/modules/maven/TestChecker.java b/java/maven/src/org/netbeans/modules/maven/TestChecker.java index af6282ab896c..27960e5966c0 100644 --- a/java/maven/src/org/netbeans/modules/maven/TestChecker.java +++ b/java/maven/src/org/netbeans/modules/maven/TestChecker.java @@ -39,11 +39,19 @@ public class TestChecker implements PrerequisitesChecker { /** - * Skip test execution. + * Skip (unit) test execution. * Do not use maven.test.skip as that skips also compilation; see #189466 for background. - * http://maven.apache.org/plugins/maven-surefire-plugin/examples/skipping-test.html + * https://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-tests.html */ public static final String PROP_SKIP_TEST = "skipTests"; // NOI18N + /** + * Skip integration test execution. + * Since surefire 3.6.0, skipTests only skips unit tests; + * integration tests must be skipped with the "skipITs" property + * https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#skipITs + * https://maven.apache.org/surefire/#3-6-0 + */ + public static final String PROP_SKIP_ITS = "skipITs"; // NOI18N @Override public boolean checkRunConfig(RunConfig config) { String action = config.getActionName(); @@ -75,6 +83,9 @@ public class TestChecker implements PrerequisitesChecker { if (config.getProperties().get(PROP_SKIP_TEST) == null) { config.setProperty(PROP_SKIP_TEST, "true"); //NOI18N } + if (config.getProperties().get(PROP_SKIP_ITS) == null) { + config.setProperty(PROP_SKIP_ITS, "true"); //NOI18N + } } } if (ActionProvider.COMMAND_TEST_SINGLE.equals(action) ||