m2eclipse:多模块和父构建异常
我是 m2eclipse 的新手,我创建了一个虚拟 java 项目(mytest4)并选中启用依赖项管理
,之后,该插件创建了一个 pom.xml 文件。我手动向虚拟项目添加了parent
信息,例如groupId
、artifactId
和version
等。然后我将模块添加到父项目中,父项目 projectType
是 pom
而不是 jar
。但是,当我使用clean install
进行构建时,出现错误:
[DEBUG] Extension realms for project com.multimod:myproject:pom:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[ERROR] The build could not read 1 project ->
[Help 1]org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Child module C:\workspace\myproject\mytest4 of C:\workspace\myproject\pom.xml does not exist @
[ERROR] The project com.multimod:myproject:0.0.1-SNAPSHOT(C:\workspace\myproject\pom.xml) has 1 error
[ERROR] Child module C:\workspace\myproject\mytest4 of C:\workspace\myproject\pom.xml does not exist
我不明白C:\workspance\myproject\pom.xml
不存在。
你能给一些提示吗? 谢谢。
I am new to m2eclipse, and I created a dummy java project (mytest4) and checked enable dependency management
, after that, the plugin created a pom.xml file. I manually added parent
information, such as groupId
, artifactId
and version
, etc. to the dummy project. Then I added modules to the parent project, and the parent projectType
is pom
not jar
. However, when I build using clean install
, I get an error:
[DEBUG] Extension realms for project com.multimod:myproject:pom:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[ERROR] The build could not read 1 project ->
[Help 1]org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Child module C:\workspace\myproject\mytest4 of C:\workspace\myproject\pom.xml does not exist @
[ERROR] The project com.multimod:myproject:0.0.1-SNAPSHOT(C:\workspace\myproject\pom.xml) has 1 error
[ERROR] Child module C:\workspace\myproject\mytest4 of C:\workspace\myproject\pom.xml does not exist
I don't understand C:\workspance\myproject\pom.xml
does not exist.
Could you give some hints?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能必须在 mytest4 pom 文件中设置父 pom 文件的相对路径。默认值为
../pom.xml
,因此您的路径为C:\workspace\myproject\pom.xml
。至于你在评论中的子问题。右键单击项目并选择
Configure >转换为 Maven 项目
You probably have to set the relative path to you parent pom file in the mytest4 pom file. The default is
../pom.xml
hence your pathC:\workspace\myproject\pom.xml
.As to your sub question in the comment. Right click on the project en select
Configure > Convert to Maven Project