服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - Java教程 - Maven分模块开发执行指令失败的问题

Maven分模块开发执行指令失败的问题

2020-09-28 00:21It_newProgrammer Java教程

Maven分模块开发,行指令失败,modules.module[3]‘ specifies duplicate child module maven_dao @ line 29, column 1的问题,本文给大家分享解决方法,感兴趣的朋友跟随小编一起看看吧

Maven工程分模块开发完成 父工程配置了 tomcat7插件,运行 run命令

Maven分模块开发执行指令失败的问题

执行run指令时失败,报错信息如下:

D:\java\JDK8\bin\java.exe "-Dmaven.multiModuleProjectDirectory=D:\Idea2020\IntelliJ IDEA 2020.1\MavenProject_parent" -Dmaven.home=D:\apache-maven-3.6.3
-Dclassworlds.conf=D:\apache-maven-3.6.3\bin\m2.conf "
-Dmaven.ext.class.path=D:\Idea2020\IntelliJ IDEA 2020.1\plugins\maven\lib\maven-event-listener.jar" "
-javaagent:D:\Idea2020\IntelliJ IDEA 2020.1\lib\idea_rt.jar=50388:D:\Idea2020\IntelliJ IDEA 2020.1\bin"
-Dfile.encoding=UTF-8 -classpath D:\apache-maven-3.6.3\boot\plexus
-classworlds-2.6.0.jar;D:\apache-maven-3.6.3\boot\plexus
-classworlds.license org.codehaus.classworlds.Launcher
-Didea.version2020.1 -s D:\apache-maven-3.6.3\conf\settings.xml
-Dmaven.repo.local=D:\apache-maven-3.6.3\my_maven_local_repository install
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'modules.module[3]' specifies duplicate child module maven_dao @ line 29, column 17
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]  
[ERROR]   The project com.idea.maven:MavenProject_parent:1.0-SNAPSHOT (D:\Idea2020\IntelliJ IDEA 2020.1\MavenProject_parent\pom.xml) has 1 error
[ERROR]     'modules.module[3]' specifies duplicate child module maven_dao @ line 29, column 17
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

分析报错原因:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'modules.module[3]' specifies duplicate child module maven_dao @ line 29, column 17

原因: 在父工程的Pom.xml 文件中,指定了重复了子模块 maven_dao

?
1
2
3
4
5
6
7
<modules>
  <module>maven_dao</module>
  <module>maven_service</module>
  <module>maven_web</module>
  <module>maven_dao</module>
 </modules>
 <packaging>pom</packaging>

解决: 直接将重复的部分删除即可正常运行Maven命令

总结

到此这篇关于Maven分模块开发执行指令失败的问题的文章就介绍到这了,更多相关Maven执行指令失败内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!

原文链接:https://blog.csdn.net/weixin_46322716/article/details/108821196

延伸 · 阅读

精彩推荐