Issue
I have a Junit test that I need to pass a system property to make the test pass. I can accomplish this using the command line like this:
mvn test -Dvin_patterns_dir=/Users/myUser/myResourceDir
And this works great, except I want to accomplish the same thing in IntelliJ IDEA. I looked into various settings in IntelliJ for Maven but not finding any.
I am using:
- Java 1.8.0_66
- Maven 3.3.9
- IntelliJ IDEA 15.0.4 Community edition.
Solution
If you're using surefire, you can simply pass system properties in your pom, See http://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html for an example. Then, in IntelliJ, simply run your project's test phase.
Answered By - Michael Peacock