Background/Situation
A user running a test with JUnit is trying to define a JVM system property in IntelliJ IDEA using a placeholder for the property name.
Question
How can I add -D${keyName} to test?
Answer
This can be achieved by the next steps:
- Add a Path variable; go to "Settings | Appearance & Behavior | Path Variables", i.e., KEY_NAME with value KeyName
-
Go to "Run | Edit Configuration | JUnit". The "Run/Debug Configurations" dialog will be opened.
-
In the "Build and Run" section, select "Modify Options." This will open the "Add Run Options" dialog. Verify "Add VM Options" is selected otherwise select it to show the desired field.
- Add the JVM property using the property name surrounded by "$", like: $KEY_NAME$ instead of ${KeyName}
Comments
0 comments
Please sign in to leave a comment.