You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2026/07/23 14:02:14 UTC

(juneau) branch master updated: Fix reactor-wide Surefire failure caused by global excludedGroups property

This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new dec66c82a2 Fix reactor-wide Surefire failure caused by global excludedGroups property
dec66c82a2 is described below

commit dec66c82a28eb31bf0258bc9b5bf37212d76c240
Author: James Bognar <ja...@apache.org>
AuthorDate: Thu Jul 23 10:02:05 2026 -0400

    Fix reactor-wide Surefire failure caused by global excludedGroups property
    
    The root pom declared a global <excludedGroups>manual</excludedGroups>
    property. Surefire's excludedGroups mojo parameter auto-binds to any
    property named "excludedGroups" in the effective POM (via
    @Parameter(property="excludedGroups")), so merely declaring it in the
    root <properties> fed it into every module's Surefire execution reactor-
    wide via inheritance - even with no <configuration> reference. Surefire
    hard-fails with "groups/excludedGroups require TestNG, JUnit48+ or JUnit
    5" as soon as that parameter is non-null (even resolving to empty), and
    several modules (e.g. juneau-rest-server-rdf) have no JUnit5 engine on
    their test classpath, breaking the build.
    
    Fix: remove the global excludedGroups property and its pluginManagement
    Surefire reference from the root pom, and instead declare a local
    excludedGroups property (default "manual", still overridable via
    -DexcludedGroups=) only in the two modules that actually contain
    @Tag("manual") tests and have the JUnit5 engine present -
    juneau-marshall and juneau-integration-tests.
    
    Co-authored-by: Cursor <cu...@cursor.com>
---
 juneau-core/juneau-marshall/pom.xml | 12 ++++++++++++
 juneau-integration-tests/pom.xml    | 13 +++++++++++--
 pom.xml                             | 23 ++++++++++++-----------
 3 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/juneau-core/juneau-marshall/pom.xml b/juneau-core/juneau-marshall/pom.xml
index 2457e40d80..511916a251 100644
--- a/juneau-core/juneau-marshall/pom.xml
+++ b/juneau-core/juneau-marshall/pom.xml
@@ -32,6 +32,11 @@
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<!-- Local (not inherited from root - see root pom's pluginManagement Surefire comment for why) default
+		     Surefire excludedGroups value, referenced via ${excludedGroups} below rather than a literal so it's
+		     still overridable on the CLI (e.g. -DexcludedGroups= to run "manual"-tagged tests like
+		     BsonArrayDebug_Test). -->
+		<excludedGroups>manual</excludedGroups>
 	</properties>
 
 	<dependencies>
@@ -75,6 +80,13 @@
 					<includes>
 						<include>**/*Test.class</include>
 					</includes>
+					<!-- This module has the JUnit5 engine on its test classpath (junit-jupiter dependency above)
+					     and contains @Tag("manual") tests (e.g. BsonArrayDebug_Test), so it's one of the few
+					     modules that declares a local ${excludedGroups} property (see <properties> above,
+					     default "manual") and wires it into its Surefire config; see the root pom's
+					     pluginManagement Surefire comment for why this isn't set reactor-wide. Still
+					     overridable via -DexcludedGroups= to run the manual tests on demand. -->
+					<excludedGroups>${excludedGroups}</excludedGroups>
 					<systemPropertyVariables>
 						<java.locale.providers>JRE,COMPAT,SPI,CLDR</java.locale.providers>
 					</systemPropertyVariables>
diff --git a/juneau-integration-tests/pom.xml b/juneau-integration-tests/pom.xml
index 4048af59f9..a2d5b3bda2 100644
--- a/juneau-integration-tests/pom.xml
+++ b/juneau-integration-tests/pom.xml
@@ -32,6 +32,11 @@
 
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<!-- Local (not inherited from root - see root pom's pluginManagement Surefire comment for why) default
+		     Surefire excludedGroups value, referenced via ${excludedGroups} below rather than a literal so it's
+		     still overridable on the CLI (e.g. -DexcludedGroups= to run "manual"-tagged tests like
+		     RoundTripLargeObjects_Test). -->
+		<excludedGroups>manual</excludedGroups>
 	</properties>
 
 	<dependencyManagement>
@@ -681,8 +686,12 @@
 					<execution>
 						<id>default-test</id>
 						<configuration>
-							<!-- ${excludedGroups} (default "manual", see root pom) is merged in here so it stays
-							     overridable via -DexcludedGroups= the same way as every other module. -->
+							<!-- ${excludedGroups} (local property above, default "manual") is merged in here so it
+							     stays overridable via -DexcludedGroups=. This module has the JUnit5 engine on its
+							     test classpath and contains @Tag("manual") tests (RoundTripLargeObjects_Test), so
+							     it's one of the few modules that wires ${excludedGroups} explicitly - it is NOT set
+							     reactor-wide in the root pom's pluginManagement Surefire config (see comment there)
+							     because that breaks modules with no JUnit5 engine on their test classpath. -->
 							<excludedGroups>container,benchmark,${excludedGroups}</excludedGroups>
 							<reportsDirectory>${project.build.directory}/surefire-reports/core</reportsDirectory>
 							<!--
diff --git a/pom.xml b/pom.xml
index aa6d485eee..48d8ce1cbb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,9 +79,6 @@
 		<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
 		<logback.version>1.5.18</logback.version>
 		<log4j.version>2.24.3</log4j.version>
-		<!-- Default Surefire excludedGroups; overridable on the CLI (e.g. -DexcludedGroups= to run "manual"-tagged
-		     tests) because it's referenced via ${excludedGroups} rather than hardcoded in the plugin config. -->
-		<excludedGroups>manual</excludedGroups>
 	</properties>
 
 	<modules>
@@ -300,19 +297,23 @@
 					Modules that define their own surefire <systemPropertyVariables> (e.g. java.locale.providers)
 					merge with these; module-level keys win on conflict.  See src/test/resources/.
 
-					Also excludes the "manual" JUnit5 tag by default so on-demand/manual-inspection tests
-					(e.g. debug harnesses, expensive stress tests) are skipped during normal builds; run them
-					explicitly with -DexcludedGroups= -Dgroups=manual.  The value comes from the ${excludedGroups}
-					property (default "manual") rather than a literal, so it can be overridden on the CLI -
-					a literal value in this <configuration> would take precedence over any -D override.
-					Modules that already override <excludedGroups> per execution (e.g. juneau-integration-tests)
-					merge ${excludedGroups} into their own exclusion lists the same way.
+					Deliberately does NOT set <excludedGroups>, nor define an "excludedGroups" property, anywhere
+					in this root pom: Surefire's excludedGroups mojo parameter is bound to a property of the
+					same name (so -DexcludedGroups=... works with zero pom.xml wiring), which means merely
+					declaring an "excludedGroups" property in <properties> - even with no <configuration> use -
+					would feed every module's Surefire execution reactor-wide via inheritance. Surefire hard-
+					fails a module with "groups/excludedGroups require TestNG, JUnit48+ or JUnit 5" as soon as
+					that parameter is non-null, even when it resolves to an empty string - and several modules
+					(e.g. juneau-rest-server-rdf) have no JUnit5 engine on their test classpath. Only the
+					modules that actually contain @Tag("manual") tests (currently juneau-marshall and
+					juneau-integration-tests) declare their own local "excludedGroups" property (default
+					"manual", still overridable via -DexcludedGroups=) and wire it into their own Surefire
+					config, since only those modules are guaranteed to have the JUnit5 engine present.
 				-->
 				<plugin>
 					<groupId>org.apache.maven.plugins</groupId>
 					<artifactId>maven-surefire-plugin</artifactId>
 					<configuration>
-						<excludedGroups>${excludedGroups}</excludedGroups>
 						<systemPropertyVariables>
 							<logback.configurationFile>${maven.multiModuleProjectDirectory}/src/test/resources/logback-test.xml</logback.configurationFile>
 							<java.util.logging.config.file>${maven.multiModuleProjectDirectory}/src/test/resources/logging.properties</java.util.logging.config.file>