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')
)
}
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('...'))
}