Add parameterization for the Maven Plugin
Closed this issue · 3 comments
Scott can be configured in various ways to fine-tune its behavior. For example, to decide what methods to instrument and what kind of error reporting mechanisms to inject to the tests.
Currently, the only way to fiddle with these parameters is to pass them as Java arguments. For example:
mvn clean install -Dscott.track.method_annotation="org.jsunit.Test,cucumber.api.java.*"
The Scott Maven Plugin should be able to receive these optional parameters, and if given, pass them to Scott.
Currently, the maven plugin can be set up like the following: (see this for a working example)
<plugin>
<groupId>hu.advancedweb</groupId>
<artifactId>scott-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
The goal of this issue to let the user provide additional configuration options, for example like this:
<plugin>
<groupId>hu.advancedweb</groupId>
<artifactId>scott-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
<configuration>
<trackMethodAnnotations>
<trackMethodAnnotation>org.junit.Test</trackMethodAnnotation>
<trackMethodAnnotation>org.junit.jupiter.api.Test</trackMethodAnnotation>
</trackMethodAnnotations>
<injectJunit4RuleMethodAnnotations>
<injectJunit4RuleMethodAnnotation>org.junit.Test</injectJunit4RuleMethodAnnotation>
</injectJunit4RuleMethodAnnotations>
</configuration>
</plugin>
The configuration options should be optional, if a configuration property is not set, it should not be passed to Scott.
To achieve this the mojo has to be enhanced to take parameters and pass them to Scott (see the getArgument
method.)
Never worked on a Maven plugin, let me take this one.
Sure!