How to deal with relative path in Junits between Maven and Intellij

前端 未结 5 1620
臣服心动
臣服心动 2021-01-30 08:37

I have a maven project with a module

/myProject
pom.xml
    /myModule
    pom.xml
       /foo
       bar.txt

Consider a Junit in myModule

5条回答
  •  余生分开走
    2021-01-30 09:20

    Solution inspired by Guillaume :

    In Run->Edit configuration->Defaults->JUnit->Working directory set the value $MODULE_DIR$ and Intellij will set the relative path in all junits just like Maven.

提交回复
热议问题