Enhancement: resolve Maven versions from a parent POM’s `dependencyManagement` in the same repository

Abierto
#720 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
57/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java, typescript

Línea de trabajo

Start with parsePom and mavenCoordinateReady in src/core-open/scanners/java-scanner.ts, then read test/fixtures/maven-multi-module, test/maven-multi-module.test.ts, and the relevant DOCS.md section. Add offline tests for parent and three level ancestor management, child version precedence, and missing or out of root parents; confirm existing vg build behavior remains deterministic. Done when scan and SBOM resolve the child versions as specified and DOCS.md describes the limitation and imported BOM scope.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement help wanted
  • Difficulty: medium
  • Area: Java / Maven / SBOM
Problem

This is already documented as a limitation, not an accident. DOCS.md says a version that exists only on a parent POM’s <dependencyManagement> is omitted on the child; the parent file may still have its own row for that pin. test/fixtures/maven-multi-module is a parent that pins commons-lang3 and gson, and a child app/pom.xml that lists both coordinates with no <version>. mavenCoordinateReady in src/core-open/scanners/java-scanner.ts (around lines 329–333, used around line 757) drops any coordinate without a concrete version. parsePom reads the parent’s coordinates for ${project.version} / ${project.groupId} but never opens the parent file (no relativePath walk) to copy managed versions onto the child.

vg scan and vg sbom export therefore miss the child’s direct dependencies in the usual multi-module layout. vg build keeps versionless coordinates on purpose (test/maven-multi-module.test.ts); this issue is about scan / SBOM versions, not the code map.

Expected behaviour

For a child POM in the same scan tree, load the parent via <relativePath> (default ../pom.xml) and, if needed, walk further ancestors still inside the scan root. Apply that chain’s <dependencyManagement> versions (and property resolution) to the child’s versionless <dependencies>. Do not fetch a parent from Maven Central. Do not treat a parent management pin as a dependency of the parent unless the parent itself declares it (keep today’s parent-row rule). Imported BOMs (<scope>import</scope>) can stay out of scope unless a follow-up is filed; say so in the docs. vg build may keep its versionless import edges; update DOCS.md so the scan column no longer says “Omitted on the child”.

Acceptance
  • Offline tests using test/fixtures/maven-multi-module (and a three-level ancestor case): the child reports commons-lang3 at 3.17.0 and gson at 2.11.0.
  • A child that already has a <version> keeps it (child wins).
  • A missing parent file or a parent outside the scan root does not fail the scan; those versionless coordinates stay omitted.
  • vg build remains deterministic and offline on the existing fixture.
  • DOCS.md is updated.

Lenguaje dominante
TypeScript
Estrellas
4
Forks
3
Merge medio
1 d 22 h
PR fusionados (30 d)
76

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vibgrate/cli

Todos los issues de vibgrate/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.