m2Eclipse dependencyManagement 部分不显示图表

发布于 2024-10-02 12:29:53 字数 330 浏览 1 评论 0原文

我不知道这是一个错误还是预期的功能,但是 m2Eclipse 的 POM 编辑器有一个很棒的图形表示(“依赖关系图”选项卡)和树(“依赖关系层次结构”选项卡)(如果依赖项都在依赖项部分)他们自己。但是,当您将它们移动到“dependencyManagement”节点(对于基于模块的项目有用)时,这些选项卡不再起作用。

有谁知道这是否是一个错误、预期的功能等?

编辑#1:依赖项管理部分中的依赖项未在父项中的依赖项管理部分之外声明。它们在子模块之间共享;为了保持一致性(我们正在建模的地方发布了一些标准)。

编辑#2:该工具在子模块级别工作。我指的是它在家长层面不起作用。

TIA

I don't know if this is a bug or intended functionality, but the POM editor for m2Eclipse has a wonderful graph representation ('Dependency Graph' tab) and tree ('Dependency Heirarchy' tab) if the dependencies are in the dependency section all by themselves. However, when you move them into the 'dependencyManagement' node (useful for module based projects) these tabs no longer work.

Does anyone know if this is a bug, intended functionality, etc?

EDIT #1: The dependencies in the dependency management section are NOT declared outside of the dependency management section in the parent. They are there to share amongst the child modules; to keep consistency (there was some standard posted somewhere that we're modeling this on).

EDIT #2: The tooling works at the child module level. I am referring to it not working at the parent level.

TIA

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

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

发布评论

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

评论(1

静谧幽蓝 2024-10-09 12:29:53

我的 POM 具有在 dependencyManagement 下声明的依赖项,它们仅按预期显示在 Dependency GraphDependency Hierarchy 选项卡中。

例如,我有一个父 POM 具有:

  <dependencyManagement>
    <dependencies>
      <!-- SL4J API -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <!-- SLF4J JDK14 Binding  -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency> 
      ...
    </dependencyManagement>

子 POM 具有:

  <dependencies>
    ...
    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>
    ...
  </dependencies>

子 POM 可以正常工作:

alt text

您在 dependencyManagement 下移动的依赖项实际上声明为依赖项吗?您能否显示一个简化的 pom.xml 来说明问题?


该工具在子模块级别工作。我指的是它在父级别不起作用。

dependencyManagement 元素中声明的依赖项不是项目的 dependency(如果我在 dependencyManagement 中声明 foo,我我仍然不依赖 foo)。如果父级未声明任何依赖项,则不会显示任何内容。

I have POMs with dependencies declared under dependencyManagement and they are just shown as expected in the Dependency Graph and Dependency Hierarchy tabs.

For example, I have a parent POM with:

  <dependencyManagement>
    <dependencies>
      <!-- SL4J API -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <!-- SLF4J JDK14 Binding  -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-jdk14</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency> 
      ...
    </dependencyManagement>

And a child POM with:

  <dependencies>
    ...
    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>
    ...
  </dependencies>

And the Dependency Graph of the child just works:

alt text

Are the dependencies you moved under dependencyManagement actually also declared as dependencies? Can you show a simplified pom.xml illustrating the problem?


The tooling works at the child module level. I am referring to it not working at the parent level.

Dependencies declared in the dependencyManagement element are not dependencies of the project (if I declare foo in the dependencyManagement, I'm still not depending on foo). If the parent doesn't declare any dependencies, there is nothing to show.

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