Passing System Properties to Unit Tests

System properties specified on the command line do not get passed to unit tests as they are running in a different JVM instance. To enable specific system properties that shall get passed you can insert the following into the maven-surefire-plugin section of the build section in the pom.xml (This has been tested with version 2.9):


You can then pass the argument by calling

mvn test



Updated: 2015-12-15 23:12