Fork me on GitHub

Requirements Compilation in Maven Build

Add this plugin to your Maven build (get their versions from Maven Central):

<build>
  <plugins>
    <plugin>
      <groupId>org.requs</groupId>
      <artifactId>requs-maven-plugin</artifactId>
      <executions>
        <execution>
          <goals>
            <goal>compile</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <artifactId>maven-site-plugin</artifactId>
      <configuration>
        <reportPlugins combine.self="append">
          <plugin>
            <groupId>org.requs</groupId>
            <artifactId>requs-maven-plugin</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>default</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </reportPlugins>
      </configuration>
    </plugin>
  </plugins>
</build>

On every run of compile phase Requs compiler will generate its output files in target/requs.

On every run of site phase you will get the same files in target/site/requs directory.

Keep your source files in src/requs with .req extension. All of them will be picked up by Requs compiler, recursively searching in all sub-directories.

Extra Configuration

You can add extra configuration parameters to be passed into Requs compiler, using options element:

<build>
  <plugins>
    <plugin>
      <groupId>org.requs</groupId>
      <artifactId>requs-maven-plugin</artifactId>
      <configuration>
        <options>
          <test.option>hello, world!</test.option>
        </options>
      </configuration>
    </plugin>
  </plugins>
</build>

All options are passed to the Compiler class as a map of strings.