m2eclipse:多模块和父构建异常

发布于 2024-12-10 07:41:55 字数 1102 浏览 0 评论 0原文

我是 m2eclipse 的新手,我创建了一个虚拟 java 项目(mytest4)并选中启用依赖项管理,之后,该插件创建了一个 pom.xml 文件。我手动向虚拟项目添加了parent信息,例如groupIdartifactIdversion等。然后我将模块添加到父项目中,父项目 projectTypepom 而不是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

堇年纸鸢 2024-12-17 07:41:55

您可能必须在 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 path C:\workspace\myproject\pom.xml.

As to your sub question in the comment. Right click on the project en select Configure > Convert to Maven Project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文