intellij-idearun-configuration

Using path variable in intellij maven run configuration


I'm trying to set up and share maven run configurations in my team and I have this problem. Every team member has different project path. I would like to use path variable in order to define working directory for maven run config. Looks like IntelliJ doesn't evaluate this path variable. Any ideas how to solve this problem?

Error:"the working directory '$MODULE_DIR$' does not exist". "$MODULE_DIR$" is default IntelliJ path variable.

enter image description here


Solution

  • You do not need to do anything. Just use the default value which is a real path to the module inside your project. IDE will automatically use the Path Variable for the Run Configuration xml file.

    Note that path variables can not be used in the UI for specifying paths. IDE automatically substitutes them when you use real paths.