cannot nest '/dubboService/src/main/resources' inside '/dubboService/src/main' .To enable the nesting exclude '/resources' from '/dubboService/src/main'

eclipse Maven--->update Project时出现以上错误:

cannot nest '/dubboService/src/main/resources'  inside '/dubboService/src/main' .To enable the nesting exclude '/resources'  from '/dubboService/src/main'

原因是pom文件中,以下配置只支持一个目录,该目录下不能有子目录:

<sourceDirectory>src/main</sourceDirectory>

但是在工程中在以上目录下存在2个子目录,所以就报错了,Maven不知道哪个才是真的源代码目录。当前工程目录结构图:

解决方法:

指定一个更具体的目录作为其源代码文件夹。配置如下:

<sourceDirectory>src/main/java</sourceDirectory>

  这样问题就解决了。

原文地址:https://www.cnblogs.com/toSeeMyDream/p/7865434.html