Skip to content

Commit

Permalink
83 add reqstool configyml to reqstool zip file (#87)
Browse files Browse the repository at this point in the history
* feat: Add reqstool prefix to property names

* feat: Add reqstool_config.yml to zip artifact

* feat: WIP

* feat: Fix logic adding files to zip file

* feat: Update docs, fix paths set in reqstool_config.yml

* feat: Fix test_results in generated reqstool_config.yml

* feat: WIP

* feat: Update configuration.adoc

* feat: WIP

* feat: Clarify default phase
  • Loading branch information
lfvdavid authored Oct 30, 2024
1 parent 78206b7 commit bababb5
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 104 deletions.
163 changes: 120 additions & 43 deletions docs/modules/ROOT/pages/configuration.adoc
Original file line number Diff line number Diff line change
@@ -1,117 +1,194 @@
== Configuration

To configure the plugin add a <configuration> block for the plugin under the <build> in pom.xml
To configure the plugin add a `<configuration>` block for the plugin under the `<build>` in pom.xml.

== Complete Configuration Example

```xml
<build>
<plugins>
<plugin>
<groupId>se.lfv.reqstool</groupId>
<artifactId>reqstool-maven-plugin</artifactId>
<version>0.1.0</version>
<configuration>
<!-- File Paths -->
<requirementsAnnotationsFile>
${project.build.directory}/generated-sources/annotations/resources/annotations.yml
</requirementsAnnotationsFile>
<svcsAnnotationsFile>
${project.build.directory}/generated-test-sources/test-annotations/resources/annotations.yml
</svcsAnnotationsFile>
<outputDirectory>
${project.build.directory}/reqstool
</outputDirectory>
<datasetPath>${project.basedir}/reqstool</datasetPath>

<!-- Test Results -->
<testResults>
<testResult>target/surefire-reports/**/*.xml</testResult>
<testResult>target/failsafe-reports/**/*.xml</testResult>
</testResults>

<!-- Project Reference -->
<project>${project}</project>
<log>${log}</log>

<!-- Execution Controls -->
<skip>false</skip>
<skipAssembleZipArtifact>false</skipAssembleZipArtifact>
<skipAttachZipArtifact>false</skipAttachZipArtifact>
</configuration>
</plugin>
</plugins>
</build>
```

== Configuration Parameters

=== requirementsAnnotationsFile

The `requirementsAnnotationsFile` parameter specifies the path to the requirements annotations file.
Defaults to the value set below.
Defaults to the value set below.

```xml
<configuration>
<requirementsAnnotationsFile>
${project.build.directory}/generated-sources/annotations/resources/annotations.yml
</requirementsAnnotationsFile>
<requirementsAnnotationsFile>
${project.build.directory}/generated-sources/annotations/resources/annotations.yml
</requirementsAnnotationsFile>
</configuration>

```

=== svcsAnnotationsFile

The `svcsAnnotationsFile` parameter specifies the path to the svcs annotations file.
Defaults to the value set below.
Defaults to the value set below.

```xml
<configuration>
<svcsAnnotationsFile>
${project.build.directory}/generated-test-sources/test-annotations/resources/annotations
</svcsAnnotationsFile>
<svcsAnnotationsFile>
${project.build.directory}/generated-test-sources/test-annotations/resources/annotations.yml
</svcsAnnotationsFile>
</configuration>

```

=== outputDirectory

The `outputDirectory` parameter specifies the path to where to put the generated output
Defaults to the value set below.
The `outputDirectory` parameter specifies the path to where to put the generated output.
Defaults to the value set below.

```xml
<configuration>
<outputDirectory>
${project.build.directory}/reqstool
</outputDirectory>
<outputDirectory>
${project.build.directory}/reqstool
</outputDirectory>
</configuration>

```

=== datasetPath

The `datasetPath` parameter specifies the path to the dataset
Defaults to the value set below.
The `datasetPath` parameter specifies the path to the dataset.
Defaults to the value set below.

```xml
<configuration>
<datasetPath>
${project.basedir}/reqstool
</datasetPath>
<datasetPath>
${project.basedir}/reqstool
</datasetPath>
</configuration>

```

=== failsafeReportsDir
=== project

The `failsafeReportsDir` parameter specifies the path to where the failsafe reports are found.
Defaults to the value set below.
The `project` parameter specifies the name of the maven project.
Defaults to the value set below.

```xml
<configuration>
<failsafeReportsDir>
${project.build.directory}/failsafe-reports
</failsafeReportsDir>
<project>
${project}
</project>
</configuration>

```

=== surefireReportsDir
=== testResults

The `surefireReportsDir` parameter specifies the path to where the surefire reports are found.
Defaults to the value set below.
The `testResults` parameter specifies one or more testResult paths.

```xml
<configuration>
<surefireReportsDir>
${project.build.directory}/surefire-reports
</surefireReportsDir>
<testResults>
<testResult>path/to/test/result.xml</testResult>
<testResult>path/to/test/result.xml</testResult>
</testResults>
</configuration>

```

=== project
=== log

The `project` parameter specifies the name of the maven project
Defaults to the value set below.
The `log` parameter specifies the log.
Defaults to the value set below.

```xml
<configuration>
<project>
${project}
</project>
<log>
${log}
</log>
</configuration>

```

=== log
=== skip

Skip the execution of the plugin.
Defaults to the value set below.

```xml
<configuration>
<skip>
false
</skip>
</configuration>

```

=== skipAssembleZipArtifact

Skip zip artifact assembly.
Defaults to the value set below.

```xml
<configuration>
<skipAssembleZipArtifact>
false
</skipAssembleZipArtifact>
</configuration>

```

=== skipAttachZipArtifact

The `log` parameter specifies the log
Defaults to the value set below.
Skip zip artifact attachment.
Defaults to the value set below.

```xml
<configuration>
<log>
${log}
</log>
<skipAttachZipArtifact>
false
</skipAttachZipArtifact>
</configuration>

```

Notes:

* All path parameters support both absolute and relative paths
* Maven property placeholders (`${...}`) can be used in all configuration values
* The plugin executes in the `verify` phase by default
* Test result paths support Ant-style pattern matching
9 changes: 7 additions & 2 deletions docs/modules/ROOT/pages/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ To use the LFV Reqstool Java Maven Plugin, add the following configuration to yo
<plugin>
<groupId>se.lfv.reqstool</groupId>
<artifactId>reqstool-maven-plugin</artifactId>
<version>0.0.2</version>
<version>0.1.0</version>
<executions>
<execution>
<goals>
<goal>attach-reqstool-zip</goal>
<goal>assemble-and-attach-zip-artifact</goal>
</goals>
</execution>
</executions>
Expand All @@ -27,3 +27,8 @@ To use the LFV Reqstool Java Maven Plugin, add the following configuration to yo
</plugins>
</build>
```

The default `<phase>` the plugin runs during is `verify`, this is done to ensure all test files are generated before the plugin runs.



Loading

0 comments on commit bababb5

Please sign in to comment.