Skip to content

Bug: Maven dependencies versioned with ${project.version} are dropped from vg scan #659

Closed

Description

@vibgrate-team

Context

In a multi-module Maven build, modules usually depend on their siblings with the built-in project properties:

<dependency>
  <groupId>${project.groupId}</groupId>
  <artifactId>core</artifactId>
  <version>${project.version}</version>
</dependency>

resolveProperty in src/core-open/scanners/java-scanner.ts (around line 304) only substitutes keys from <properties>, so ${project.version}, ${project.parent.version} and ${project.groupId} are left as written. scanOneJavaProject (around line 597) then skips any dependency whose version still contains ${, so these rows disappear from vg scan and vg sbom export without any message.

What to do

  1. Pass the project's own coordinates into property resolution: project.version, project.groupId, project.artifactId, project.parent.version, project.parent.groupId (with the existing parent fallback for version and groupId), plus the older pom.version / version aliases if cheap.
  2. Explicit <properties> keys keep priority.
  3. Add a fixture with a parent POM and two modules where one depends on the other through ${project.version}.

Acceptance

  • A sibling dependency written with ${project.version} appears as a row with the resolved version
  • ${project.groupId} in a groupId resolves too
  • A version that inherits from <parent><version> resolves through ${project.version}
  • Unknown property references are still skipped as today

Activity

  1. added
    bug
    on Nov 12, 2026
  2. vibgrate-team commented on Nov 12, 2026

    @vibgrate-team
    ContributorAuthor

    Confirmed. resolveProperty (line 304 of java-scanner.ts) only substitutes keys from <properties>, and scanOneJavaProject then drops any dependency whose version still contains ${ (line 597), so sibling-module dependencies vanish.

    Suggestions:

    • Build a merged lookup before resolving: the POM's <properties> first, then project.version (falling back to parent.version), project.groupId (falling back to parent.groupId), project.artifactId, project.parent.version, project.parent.groupId, and the pom.* aliases. Explicit properties should win.
    • Resolve groupId as well as version; right now only the version is checked, so a ${project.groupId} key would also produce a strange row.
    • Keep the "skip if still unresolved" guard for genuinely unknown properties.

    We'll pick this up from the team side.

  3. added a commit that references this issue on Nov 12, 2026
    08d5790
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions