Reqstool Java Annotations

Description

This provides Java annotations and processing of annotated code.

Enables the usage of @Requirements and @SVCs annotations and processors to collect, format and write annotations data to yaml files.

Installation

To add dependency using Maven, add the following to your pom.xml:

<dependency>
	<groupId>se.lfv.reqstool</groupId>
	<artifactId>reqstool-annotations-java</artifactId>
	<version>0.0.6</version>
</dependency>

Usage

Annotations

The annotations available to use are @Requirements and @SVCs.

Example usage of @Requirements annotations:

  • Single argument

@Requirements("REQ_020")
public void someMethod() {
		System.out.println("Some Method");
	}
  • Multiple arguments

@Requirements({ "REQ_010", "ext-001:REQ_100" })
public void otherMethod() {
		System.out.println("Other Method");
	}

The same structure is used for @SVCs annotations.

Processors

Collects annotations data, formats it and generates yaml files containing all annotations, one file for @Requirements and one file for @SVCs.

Processors save the YAML files as annotations.yml.

YAML file containing @Requirements annotations is generated in /target/generated-sources/annotations/resources

YAML file containing @SVCs annotations is generated in /target/generated-test-sources/test-annotations/resources

Debugging

For debugging info of Annotations Processor -Dmaven.compiler.showWarnings=true or add showWarning = true to maven-compiler-plugin configuration:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <showWarnings>true</showWarnings>
        <verbose>true</verbose>
    </configuration>
</plugin>