1、找到项目下的 .idea\workspace.xml打开
2、搜索PropertiesComponent标签,在其中加入如下节点

<property name="dynamic.classpath" value="true" />

个人觉得,这种方法比设置Edit Configuration配置文件好用