Configuration
The plugin provides zero-configuration defaults that match the standard Gradle project layout. Override only what you need.
Configuration reference
| Property | Type | Default | Description |
|---|---|---|---|
|
|
|
Requirements annotations YAML file generated by the annotation processor for the main source set |
|
|
Auto-discovered from all non-main source sets |
SVCs annotations YAML files, one per test source set (e.g. |
|
|
— |
Deprecated since 0.1.1. Use |
|
|
|
Output directory for the ZIP artifact and combined |
|
|
|
Directory containing |
|
|
|
Ant-style glob patterns for test result XML files to include in the ZIP |
|
|
|
Skip all plugin execution |
|
|
|
Skip ZIP assembly; annotations are still combined into |
|
|
|
Skip attaching the ZIP artifact to Maven publications |
Dataset directory
The datasetPath directory must contain at minimum a requirements.yml file.
Optional files in the same directory are included if present.
| File | Required |
|---|---|
|
Yes |
|
No |
|
No |
Minimal configuration
Only datasetPath needs to be set when the dataset lives outside the default reqstool/ directory:
requirementsTool {
datasetPath = file('docs/reqstool')
}
Complete configuration example
requirementsTool {
requirementsAnnotationsFile =
file('build/generated/sources/annotationProcessor/java/main/resources/annotations.yml')
// svcsAnnotationsFiles is a file collection — use .from() to add files additively
svcsAnnotationsFiles.from(
file('build/generated/sources/annotationProcessor/java/test/resources/annotations.yml')
)
outputDirectory = file('build/reqstool')
datasetPath = file('docs/reqstool')
testResults = ['build/test-results/**/*.xml']
skip = false
skipAssembleZipArtifact = false
skipAttachZipArtifact = false
}
Overriding auto-discovered annotation files
svcsAnnotationsFiles is auto-discovered from all non-main source sets.
To replace auto-discovery with explicit paths (also disables auto-wired compile dependencies for test source sets):
requirementsTool {
setSvcsAnnotationsFiles(
file('custom/path/test-annotations.yml'),
file('custom/path/it-annotations.yml')
)
}
JUnit 5 parameterized tests
Gradle’s JUnit XML reporter writes test case names using the parameterized test’s display name.
By default this is [N] arguments — a format that omits the method name.
Reqstool cannot link these entries to @SVCs-annotated methods without the method name.
Add the following to your build to make the method name part of every test case name, across all test tasks (unit, integration, e2e):
tasks.withType(Test).configureEach {
systemProperty 'junit.jupiter.params.displayname.default', '{displayName}[{index}]'
}
Kotlin DSL:
tasks.withType<Test>().configureEach {
systemProperty("junit.jupiter.params.displayname.default", "{displayName}[{index}]")
}
This changes the default display name for every @ParameterizedTest that does not have an
explicit name = attribute, producing names like checkStatus(StatusType)[1] instead of
[1] ACTIVE.
Tests that use an explicit @ParameterizedTest(name = "{index} …") still omit the
method name because the explicit value overrides the default.
Either remove the custom name or change it to begin with {displayName}:
@ParameterizedTest(name = "{displayName}[{index}] …").
|
Maven Surefire is unaffected — it always embeds the method name regardless of display-name settings, so no configuration change is required for Maven projects.
Auto-wired task dependencies
When the java plugin is applied, the plugin automatically wires:
-
assembleRequirementsdepends oncompileJava(main source set) -
assembleRequirementsdepends oncompileXxxJavafor each non-main source set (unlesssvcsAnnotationsFileswas set explicitly viasetSvcsAnnotationsFiles(…)) -
buildis finalized byassembleRequirements
No manual dependsOn or finalizedBy blocks are needed in the consuming project.
If an annotation file is missing at execution time (e.g. when a compile task was excluded), the plugin emits a WARN message identifying the missing file.
Deprecation notice
The svcsAnnotationsFile property (singular) from plugin 0.1.0 has been replaced by
svcsAnnotationsFiles (plural, a ConfigurableFileCollection).
The old property still works but emits a deprecation warning and will be removed in a future release.
// Deprecated — emits a warning; delegates to svcsAnnotationsFiles.from(...)
requirementsTool {
svcsAnnotationsFile = file('...')
}
// Preferred — additive
requirementsTool {
svcsAnnotationsFiles.from(file('...'))
}