多模块项目Module must not contain source root. The root already belongs to module
来源:互联网 发布:php条件判断语句 编辑:程序博客网 时间:2024/05/26 14:08
多模块项目Module “*” must not contain source root *. The root already belongs to module “*”.
有时候新建了maven工程,然后删了里面的src目录让它成为空的父项目,但是会报下面的错误。
Module “*” must not contain source root *. The root already belongs to module “*”.
打开工程的iml文件后,发现里面记录了开始的源文件和资源文件的配置。
<?xml version="1.0" encoding="UTF-8"?><module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false"> <output url="file://$MODULE_DIR$/target/classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <excludeFolder url="file://$MODULE_DIR$/target" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> </component></module>
修改以后的
<?xml version="1.0" encoding="UTF-8"?><module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false"> <output url="file://$MODULE_DIR$/target/classes" /> <output-test url="file://$MODULE_DIR$/target/test-classes" /> <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/target" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> </component></module>
网上的另一种解决方式:
在项目设置中, 右侧有源文件、资源文件等 目录列表
删除不是子工程该有的目录。
阅读全文
0 0
- 多模块项目Module must not contain source root. The root already belongs to module
- Android项目中module的“must not contain source root....”问题
- CMake Error: The source directory "/root/mysql-5.5.29-linux2.6-x86_64" does not appear to contain CM
- The ResourceConfig instance does not contain any root resource classes
- studio无法重命名(can not rename root module)
- bug:m2eclipse中build多模块maven项目报错:The source must not be a directory
- can't rename root module
- can't rename root module
- Can't rename root module
- can't rename root module
- can't rename root module,Android Studio修改项目名称
- Could not use "Ocean configurator" to add the ocean module to the ocean module project
- Module 'starter' is not available! You either misspelled the module name or forgot to load it.
- Invalid root. The WEB-INF/flex folder must contain either flex-config.xml or services-config.xml 错误相关
- 错误记录--Invalid root. The WEB-INFflex folder must contain either flex-config.xml or services-config.xml
- Add the module to kerenl
- The first module to linux
- CMake Error: The source directory "/xxx/mysql-5.6.21" does not appear to contain CMakeLists.txt
- BATMAN
- C语言数据类型
- 【Linux多线程】同步与互斥的区别
- Android进阶之路
- 欢迎使用CSDN-markdown编辑器
- 多模块项目Module must not contain source root. The root already belongs to module
- CMD提示不是外部命令,也不是可运行的程序或批处理文件
- 机器学习算法集锦:从贝叶斯到深度学习及各自优缺点
- R语言线性回归
- Set Tab Off
- tm32f10x_conf.h
- 创建maven工程常见的错误
- 欢迎使用Markdown编辑器写博客
- html学习