编译器问题:运行maven,报错-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

时间:2022-06-17 17:24:12

1、新建环境变量M2_HOME

2、指向你的maven安装目录

例如 :M2_HOME=D:\Apps\apache-maven-3.3.9

3、进入Myeclipse进行修改,Window->Preference->Java->Installed JREs

4、进入1位置,双击2

编译器问题:运行maven,报错-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

5、增加语句  -Dmaven.multiModuleProjectDirectory=$M2_HOME到红圈的位置

编译器问题:运行maven,报错-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

6、再次运行,就会成功