This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git
The following commit(s) were added to refs/heads/master by this push:
new abf3dba9b Add configuration for 3.5.x branch (dependabot/release
drafter) (#3271)
abf3dba9b is described below
commit abf3dba9b9165d3bf9ef5ac3e95977f72da69572
Author: Olivier Lamy <[email protected]>
AuthorDate: Tue Feb 24 18:37:20 2026 +1000
Add configuration for 3.5.x branch (dependabot/release drafter) (#3271)
Signed-off-by: Olivier Lamy <[email protected]>
---
.github/copilot-instructions.md | 119 ++++++++++++++++++++++++++++++++++++++++
.github/dependabot.yml | 15 +++++
.github/release-drafter-3.x.yml | 19 +++++++
3 files changed, 153 insertions(+)
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 000000000..aa07c8d05
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,119 @@
+# Apache Maven Surefire - Copilot Instructions
+
+## Build Commands
+
+```bash
+# Full build (unit tests only, no integration tests)
+mvn clean install
+
+# Full build with integration tests
+mvn clean install -P run-its
+
+# Build a single module
+mvn clean install -pl surefire-api
+mvn clean install -pl surefire-booter
+
+# Skip tests during build
+mvn clean install -DskipTests
+
+# Run unit tests for a single module
+mvn test -pl maven-surefire-common
+
+# Run a single test class
+mvn test -pl surefire-booter -Dtest=ForkedBooterTest
+
+# Run a single test method
+mvn test -pl surefire-booter -Dtest=ForkedBooterTest#testMethod
+
+# Run a single integration test (requires -P run-its)
+mvn verify -pl surefire-its -Prun-its -Dit.test=JUnit47RedirectOutputIT
-Dmaven.build.cache.enabled=false
+
+# Build site documentation
+mvn site -pl maven-surefire-plugin
+
+# Checkstyle (inherited from maven-parent, suppressions in
src/config/checkstyle-suppressions.xml)
+mvn checkstyle:check
+```
+
+## Architecture
+
+### Module Dependency Flow
+
+```
+maven-surefire-plugin / maven-failsafe-plugin (Maven Mojos - entry points)
+ │
+ ▼
+maven-surefire-common (AbstractSurefireMojo - shared Mojo logic)
+ │
+ ├──▶ surefire-booter (ForkedBooter - JVM fork entry point)
+ │
+ ├──▶ surefire-api (Provider SPI, report API, stream protocol)
+ │
+ ├──▶ surefire-extensions-api / surefire-extensions-spi
+ │
+ └──▶ surefire-providers/surefire-junit-platform (unified test
execution)
+```
+
+### Forked JVM Architecture
+
+Surefire executes tests in a **forked JVM** separate from the Maven process.
Understanding this split is essential:
+
+- **Maven side** (`maven-surefire-common`): `AbstractSurefireMojo` configures
and launches the fork. `booterclient/` handles communication with the forked
process.
+- **Forked side** (`surefire-booter`): `ForkedBooter.main()` is the entry
point. It deserializes configuration, loads the provider, and runs tests.
Communicates results back via an event-based binary stream protocol.
+- **Shared contract** (`surefire-api`): Defines the `SurefireProvider` SPI,
report events, and the stream protocol used between Maven and forked processes.
+
+### Shading Strategy
+
+Two modules exist solely for classpath isolation:
+
+- **`surefire-shared-utils`**: Shades commons-lang3, commons-io,
commons-compress, and maven-shared-utils into
`org.apache.maven.surefire.shared.*` to avoid version conflicts with user
projects.
+- **`surefire-shadefire`**: Shades the entire surefire-junit-platform provider
(plus surefire-api, surefire-booter) into `org.apache.maven.shadefire.*` so
Surefire can test **itself** without classpath conflicts during its own build.
+
+### Provider Model
+
+All test frameworks execute through the JUnit Platform provider
(`surefire-providers/surefire-junit-platform`):
+
+- **JUnit 5**: Runs natively via Jupiter Engine
+- **JUnit 4** (4.12+): Runs via Vintage Engine
+- **TestNG** (6.14.3+): Runs via TestNG JUnit Platform Engine
+
+Legacy providers (`surefire-junit3`, `surefire-junit4`, `surefire-junit47`,
`surefire-testng`) still exist in the tree but are being consolidated.
+
+### Integration Tests
+
+`surefire-its` contains integration tests that launch real Maven builds
against fixture projects in `surefire-its/src/test/resources/`. These require
the `run-its` profile and test the full fork lifecycle end-to-end. They use
`maven-verifier` to invoke Maven and assert on build output.
+
+## Key Conventions
+
+### Java Version
+
+Source and target is **Java 8**. The `animal-sniffer-maven-plugin` enforces
the `java18` API signature. JDK 9+ APIs must be accessed via reflection (see
`ProcessHandleChecker` for an example using `ReflectionUtils`).
+
+A `jdk9+` profile auto-activates on JDK 9+ to add `--add-opens` flags for test
execution.
+
+### Reflection Utilities
+
+When accessing APIs not available at compile time (e.g., Java 9+ APIs), use
`ReflectionUtils` from `surefire-api` rather than raw reflection:
+
+- `tryLoadClass(classLoader, className)` → returns `null` on failure
+- `tryGetMethod(clazz, name, params)` → returns `null` on failure
+- `invokeMethodWithArray(target, method, args)` → wraps exceptions in
`SurefireReflectionException`
+
+### IDE Setup
+
+Before importing into an IDE, run:
+
+```bash
+mvn install -P ide-development -f surefire-shared-utils/pom.xml
+mvn compile -f surefire-grouper/pom.xml
+```
+
+The `ide-development` profile resolves IntelliJ IDEA artifact classifier
issues. The `surefire-grouper` module needs a compile pass to generate JavaCC
sources in `target/generated-sources/javacc`.
+
+### Formatting
+
+Follows `.editorconfig`: 4-space indentation for Java, 2-space for XML.
Checkstyle rules are inherited from the Maven parent POM with project-specific
suppressions in `src/config/checkstyle-suppressions.xml`.
+
+### Test Isolation
+
+Surefire uses a **different version of itself** to run its own tests (see
`maven-surefire-plugin` version in `<pluginManagement>` vs
`${project.version}`). The `surefire-shadefire` module enables this
self-testing. The surefire plugin configuration sets
`useSystemClassLoader=false` to isolate the version under test.
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 86cd35a95..a8a7d1eb7 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -17,6 +17,7 @@
version: 2
updates:
- package-ecosystem: "maven"
+ target-branch: "master"
directory: "/"
schedule:
interval: "daily"
@@ -24,6 +25,20 @@ updates:
# Ignore Maven Core updates
- dependency-name: "org.apache.maven:*"
- package-ecosystem: "github-actions"
+ target-branch: "master"
+ directory: "/"
+ schedule:
+ interval: "daily"
+- package-ecosystem: "maven"
+ target-branch: "surefire-3.5.x"
+ directory: "/"
+ schedule:
+ interval: "daily"
+ ignore:
+ # Ignore Maven Core updates
+ - dependency-name: "org.apache.maven:*"
+- package-ecosystem: "github-actions"
+ target-branch: "surefire-3.5.x"
directory: "/"
schedule:
interval: "daily"
diff --git a/.github/release-drafter-3.x.yml b/.github/release-drafter-3.x.yml
new file mode 100644
index 000000000..397c693bd
--- /dev/null
+++ b/.github/release-drafter-3.x.yml
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+_extends: maven-gh-actions-shared
+tag-template: maven-surefire-$RESOLVED_VERSION