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

Đang mở
#720 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
57/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, typescript
Lĩnh vực
backend, databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
4
Fork
3
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
76

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vibgrate/cli

Tất cả issue của vibgrate/cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.