It really depends on what exactly you want to achieve.
If you want to help write the maven plugin in general, you need to read the documentation .
If you want to filter out the properties of the system that the Maven JVM switches to the test JVM, I see no other option than expanding the maven-surefire-plugin and adding an option for such a mapping there. (Note that by default, Maven passes all of its system properties to the test JVM.) This is definitely doable, but perhaps you can achieve your goal with what maven already offers.
You can definitely pass additional system properties to the test JVM from Maven using:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19</version> <configuration> <systemPropertyVariables> <propertyName>propertyValue</propertyName> <anotherProperty>${myMavenProperty}</buildDirectory> </systemPropertyVariables> </configuration> </plugin>
as described by http://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html .
In this case, you can set the value of anotherProperty from the command line by calling maven
mvn test -DmyMavenProperty=theValueThatWillBePassedToTheTestJVMAsProperty_anotherProperty
You can also use Surefire argline to pass multiple JVM properties. For instance,
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.19</version> <configuration> <argLine>${propertiesIWantToSetFromMvnCommandLine}</argLine> </configuration> </plugin>
and do maven as follows
mvn test -DpropertiesIWantToSetFromMvnCommandLine="-Dfoo=bar -Dhello=ahoy"
in this case, you will see the properties foo and hello with the values bar and ahoy , respectively, in the test JVM.