尝试连接模块 pom 和父 pom。如何设置相对路径?

发布于 2024-12-29 20:48:42 字数 578 浏览 4 评论 0原文

我还没有找到合适的例子,所以我在这里问:

我的项目结构是

workspace
|
|-->plugins
| |
| --> some.plugin.folder
| |
| --> parentpom.xml
| 
|-->tests
  |
  |-->some.test.plugin.folder
    |
    |--> pom.xml

好的,我可以在parentpom.xml中添加测试模块。

<module>../tests/some.test.plugin.folder</module>

但我一生都无法在测试插件的 pom.xml 中找到父 pom 的正确相对路径。

<parent>
    ...
    <relativePath>../../plugins/parentpom.xml</relativePath>
</parent>

有人可以帮助我吗?或者不可能使用两个 ../ ?

I haven't found an appropriate example for this, so I ask here:

My project structure is

workspace
|
|-->plugins
| |
| --> some.plugin.folder
| |
| --> parentpom.xml
| 
|-->tests
  |
  |-->some.test.plugin.folder
    |
    |--> pom.xml

Okay, I can add test modules in the parentpom.xml.

<module>../tests/some.test.plugin.folder</module>

But I can't for the life of me find the correct relative path to the parent pom in the pom.xml of the test plugin.

<parent>
    ...
    <relativePath>../../plugins/parentpom.xml</relativePath>
</parent>

Can someone help me? Or is it impossible to use two ../ ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

落叶缤纷 2025-01-05 20:48:42

模块中名为 some.test.plugin.folder 的相对路径应该只是路径,不包含文件名。它应该是:

<relativePath>../../plugins</relativePath>

此外,您的父模块应该有一个 pom.xml,因此将 parentpom.xml 重命名为 pom.xml

The relative path in your module called some.test.plugin.folder should be a path only and not contain a file name. It should be:

<relativePath>../../plugins</relativePath>

Also your parent module should have a pom.xml, so rename parentpom.xml to pom.xml.

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