Problem
The plugin assumes a single test source set, which matches Maven's model. In Gradle projects that use multiple test source sets (e.g. a separate integrationTest JvmTestSuite), the annotation processor runs once per compilation task and produces one annotations.yml per source set:
| Compilation task |
Annotation output |
compileJava |
build/generated/sources/annotationProcessor/java/main/resources/annotations.yml |
compileTestJava |
build/generated/sources/annotationProcessor/java/test/resources/annotations.yml |
compileIntegrationTestJava |
build/generated/sources/annotationProcessor/java/integrationTest/resources/annotations.yml |
RequirementsToolExtension only exposes a single svcsAnnotationsFile (RegularFileProperty), hardcoded by default to the test source set output. The integrationTest annotations are silently ignored.
Impact: @SVCs annotations placed on integration test methods are never picked up by reqstool status, resulting in artificially low SVC coverage even when tests exist.
Root cause
RequirementsToolExtension.java (line 49):
this.svcsAnnotationsFile.convention(project.getLayout()
.getBuildDirectory()
.file("generated/sources/annotationProcessor/java/test/resources/annotations.yml"));
RequirementsToolTask.execute() reads a single file:
File svcsAnnotFile = svcsAnnotationsFile.getAsFile().getOrNull();
if (svcsAnnotFile != null && svcsAnnotFile.exists()) {
testsNode = yamlMapper.readTree(svcsAnnotFile).path(XML_REQUIREMENT_ANNOTATIONS).path(XML_TESTS);
}
Proposed fix
- Change
svcsAnnotationsFile (RegularFileProperty) → svcsAnnotationsFiles (ConfigurableFileCollection) in both RequirementsToolExtension and RequirementsToolTask
- Default the collection to all known test-scope annotation outputs (auto-discover
JvmTestSuite source sets, or at minimum include test + any additional suites)
- In
RequirementsToolTask.execute(), merge all tests nodes from all provided files (deep-merge by SVC ID, concatenating the entry lists)
Backwards compatible: a single-file config still works; multi-suite projects get correct coverage without workarounds.
Workaround
Currently requires a custom Gradle task to merge the two annotation files before passing the result to svcsAnnotationsFile — an unnecessary build-script burden.
Problem
The plugin assumes a single test source set, which matches Maven's model. In Gradle projects that use multiple test source sets (e.g. a separate
integrationTestJvmTestSuite), the annotation processor runs once per compilation task and produces oneannotations.ymlper source set:compileJavabuild/generated/sources/annotationProcessor/java/main/resources/annotations.ymlcompileTestJavabuild/generated/sources/annotationProcessor/java/test/resources/annotations.ymlcompileIntegrationTestJavabuild/generated/sources/annotationProcessor/java/integrationTest/resources/annotations.ymlRequirementsToolExtensiononly exposes a singlesvcsAnnotationsFile(RegularFileProperty), hardcoded by default to thetestsource set output. TheintegrationTestannotations are silently ignored.Impact:
@SVCsannotations placed on integration test methods are never picked up byreqstool status, resulting in artificially low SVC coverage even when tests exist.Root cause
RequirementsToolExtension.java(line 49):RequirementsToolTask.execute()reads a single file:Proposed fix
svcsAnnotationsFile(RegularFileProperty) →svcsAnnotationsFiles(ConfigurableFileCollection) in bothRequirementsToolExtensionandRequirementsToolTaskJvmTestSuitesource sets, or at minimum includetest+ any additional suites)RequirementsToolTask.execute(), merge alltestsnodes from all provided files (deep-merge by SVC ID, concatenating the entry lists)Backwards compatible: a single-file config still works; multi-suite projects get correct coverage without workarounds.
Workaround
Currently requires a custom Gradle task to merge the two annotation files before passing the result to
svcsAnnotationsFile— an unnecessary build-script burden.