Idea maven项目,无法引入jar包,Source root cannot be defined in module

错误:Source root cannot be defined in module A because it belongs to content of nested module A.Child。

A项目为一个空的maven项目,是A.Child项目的父项目。在A.Child项目中引入jar包ojdbc.jar时,提示:
Source root cannot be defined in module A because it belongs to content of nested module A.Child。

原因:
A项目,A.child项目具有相同的source folder,导致冲突。

解决办法:
依次打开“project structure/project settings/modules”,选择A项目,在source部分,删除A项目的source folder即可。然后在A.child项目中,引入ojdbc.jar

发布了18 篇原创文章 · 获赞 19 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/xujinggen/article/details/90239868