This is a major release with breaking changes. Please review the upgrade notes carefully.
The Cucumber plugin classes have been moved from io.cucumber.core.plugin to net.serenitybdd.cucumber.core.plugin to resolve Java Platform Module System (JPMS) split package violations.
Required Action for JUnit 5 Users:
Update your test suite configuration:
// BEFORE (4.x)
@ConfigurationParameter(
key = PLUGIN_PROPERTY_NAME,
value = "io.cucumber.core.plugin.SerenityReporterParallel"
)
// AFTER (5.0.0)
@ConfigurationParameter(
key = PLUGIN_PROPERTY_NAME,
value = "net.serenitybdd.cucumber.core.plugin.SerenityReporterParallel"
)Impact: All users running Cucumber tests with JUnit 5 must update their plugin configuration.
Migration: See MIGRATION_5.0.0.md for detailed migration instructions.
JUnit 4 Cucumber integration is now officially deprecated and marked for removal in Serenity 6.0.0.
Affected Classes:
io.cucumber.junit.CucumberSerenityRunnerio.cucumber.junit.CucumberSerenityBaseRunnernet.serenitybdd.cucumber.CucumberWithSerenity
Rationale:
- JUnit 5 was released in September 2017 (8+ years ago)
- JUnit 4 runners must remain in
io.cucumber.junitpackage to access package-private Cucumber classes - This creates split package violations incompatible with JPMS (Java Platform Module System)
- When Cucumber migrates to Java 17+ with JPMS modules, JUnit 4 integration will stop working
Timeline:
- Serenity 5.x: JUnit 4 support deprecated but functional (deprecation period)
- Serenity 6.0.0: Complete removal of JUnit 4 Cucumber support
Action Required: Plan migration from JUnit 4 to JUnit 5. See the migration guide for step-by-step instructions.
This release significantly improves compatibility with the Java Platform Module System (JPMS):
- Reduced Split Packages: Migrated 12 classes out of
io.cucumber.*packages intonet.serenitybdd.cucumber.*packages - Package Structure Cleanup: Serenity classes now properly reside in Serenity-owned packages
- Future-Proofing: Prepares for Cucumber's planned migration to Java 17+ with JPMS modules
Classes Migrated:
From io.cucumber.core.plugin → net.serenitybdd.cucumber.core.plugin:
FeatureFileLoaderScenarioContextScenarioContextParallelSerenityReporterSerenityReporterParallelConfigureDriverFromTagsFeaturePathFormatterFeatureTrackerLineFiltersManualScenarioCheckerScenarioTagProcessorTaggedScenarioUpdateManualScenarioTestSourcesModel(new Serenity-owned implementation)
From io.cucumber.gherkin → net.serenitybdd.cucumber.gherkin:
CucumberScenarioLoaderScenarioLineCountStatisticsIncrementingIdGeneratorGherkinDocumentParser(new)InvalidGherkinException(new)
From cucumber.runtime → net.serenitybdd.cucumber.runtime:
SerenityBackendSerenityObjectFactory
From io.cucumber.junit → net.serenitybdd.cucumber.util:
LiteralExpression- Utility methods from
FeatureRunnerExtractors
Created a Serenity-owned implementation of TestSourcesModel using Cucumber's public GherkinParser API, eliminating dependency on Cucumber's package-private internal class.
Benefits:
- No longer dependent on Cucumber internals
- Uses only public, stable Cucumber APIs
- Reduces risk of breakage from Cucumber internal changes
- Better separation of concerns
Added comprehensive migration documentation:
-
MIGRATION_5.0.0.md: Complete migration guide covering:
- Breaking changes with before/after examples
- Step-by-step JUnit 4 to JUnit 5 migration
- Configuration parameter mapping reference
- Parallel execution setup
- Common issues and solutions
-
CUCUMBER_API_REQUIREMENTS.md: Technical documentation for Cucumber team explaining Serenity's API requirements (relevant for future Cucumber development)
Resolved issue where the screenshot viewer in reports would always open at the first screenshot (index 0) regardless of which screenshot thumbnail was clicked.
Issue: #3685
Fixed an issue where sorting test results by outcome (passed, failed, etc.) was not working correctly.
Issue: #3700
- Groovy: 4.0.23 → 4.0.29
- Adds support for JDK 25
- Resolves "Unsupported class file major version 69" error
- Created
CucumberInternalUtilsclass to replace package-private Cucumber utility methods with public API equivalents - Simplified duplicate utility code that was only 5-10 lines
- Improved code maintainability and reduced coupling with Cucumber internals
Version Update:
Update your pom.xml or build.gradle:
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>5.0.0</version>
</dependency>Required: Update plugin configuration in all test suite classes:
Find and Replace:
io.cucumber.core.plugin.SerenityReporter→net.serenitybdd.cucumber.core.plugin.SerenityReporterio.cucumber.core.plugin.SerenityReporterParallel→net.serenitybdd.cucumber.core.plugin.SerenityReporterParallel
Example:
@Suite
@IncludeEngines("cucumber")
@SelectClasspathResource("features")
@ConfigurationParameter(
key = PLUGIN_PROPERTY_NAME,
value = "net.serenitybdd.cucumber.core.plugin.SerenityReporterParallel" // Updated path
)
public class CucumberTestSuite {}No immediate action required, but plan for migration:
- JUnit 4 Cucumber support is deprecated and will be removed in version 6.0.0
- You will see deprecation warnings when compiling
- Tests will continue to work in version 5.x
- Review the migration guide and plan transition to JUnit 5
Migration Resources:
- MIGRATION_5.0.0.md - Complete step-by-step guide
- JUnit 5 offers better parallel execution and modern features
- JUnit 5 has been stable since 2017
If you have custom code that references moved classes, update package imports:
// OLD
import io.cucumber.core.plugin.FeatureFileLoader;
import io.cucumber.gherkin.ScenarioLineCountStatistics;
// NEW
import net.serenitybdd.cucumber.core.plugin.FeatureFileLoader;
import net.serenitybdd.cucumber.gherkin.ScenarioLineCountStatistics;The JUnit 4 runners (CucumberSerenityRunner, CucumberSerenityBaseRunner) must remain in the io.cucumber.junit package to access package-private Cucumber classes. This creates a split package violation that will prevent JPMS compatibility when Cucumber migrates to Java 17+ modules.
Resolution: Migrate to JUnit 5 (see migration guide). JUnit 4 support will be removed in Serenity 6.0.0.
- Migration Guide: MIGRATION_5.0.0.md
- GitHub Discussions: serenity-bdd/serenity-core/discussions
- GitHub Issues: serenity-bdd/serenity-core/issues
Q: Do I need to update if I'm not using Cucumber? A: No, if you're not using Cucumber integration, this release has no breaking changes for you.
Q: Can I continue using JUnit 4 with Cucumber in 5.0.0? A: Yes, but it's deprecated. It will be removed in 6.0.0. We recommend migrating to JUnit 5.
Q: Will my existing tests break? A: Only if you're using JUnit 4 with Cucumber. You need to update the plugin path in your test suite configuration.
Q: How long do I have to migrate from JUnit 4? A: You have the entire 5.x release cycle (anywhere between 3 and 12 months) before JUnit 4 support is removed in 6.0.0.
This release represents a significant architectural improvement to prepare Serenity BDD for the future of Java modules and evolving Cucumber integration requirements.
Special thanks to the Cucumber team for their collaboration on the API requirements discussion.
Full Changelog: https://github.com/serenity-bdd/serenity-core/compare/v4.3.4...v5.0.0