Skip to content

fix: [INFRA-673] Fix Jar properties extraction and Gradle support - #293

Merged
alexs-aero merged 8 commits into
mainfrom
fix-673-fix-jar-meta-getter
Aug 26, 2026
Merged

fix: [INFRA-673] Fix Jar properties extraction and Gradle support#293
alexs-aero merged 8 commits into
mainfrom
fix-673-fix-jar-meta-getter

Conversation

@alexs-aero

@alexs-aero alexs-aero commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Brief

Currently, if a specific JAR parent-child artifact would be posted with empty fields, it could result in empty properties and render workflow corrupted.

This PR extracts Jar property/coordinate handling into separate helper and updates all calls to use extracted properties

Summary

  • INFRA-673: Fix JAR GAV extraction. Shared maven-helpers reads sibling POMs (including parent inheritance) so flat JARs and child modules resolve groupId/artifactId/version instead of falling back to filename parsing. Document shaded-JAR pom.properties behavior.
  • INFRA-696: Publish Gradle Module Metadata with the Maven set. Structure and upload .module next to jar/pom (nested GAV and POM-only BOMs), include .module.asc in build-info, upload .module.md5/.sha1 without build-info, and keep signed checksums out of JFrog. Sign .module in the GPG pass.
  • Tests/docs: Cover nested my-app-1.0.0.module, standalone BOM + .module, and a registry guard so TYPE_COMPANIONS[jar] does not suffix-append .module.

Changes

  • Extract shared Maven POM parsing into lib/maven-helpers.sh:
    • _maven_read_pom_coordinates — full GAV + packaging/module count, with <parent> fallback
    • _maven_read_pom_gav — GAV-only wrapper for callers that do not need packaging metadata
  • Use pipe-delimited output so empty fields do not shift on read
  • Update get_jar_metadata sibling-POM path to merge only non-empty POM values (filename-derived fields preserved when POM leaves them blank)
  • Reuse the helper in type_detection.sh and entrypoint.sh pom-only upload path (same parent-inheritance bug)
  • Remove duplicate XPath logic from type_detection.sh; simplify _pom_matches_flatten_resolved_heuristic to a single coordinate read
  • Add make_flat_jar_with_pom test helper in maven_fixtures.bash
  • Add docs/maven_lookup.md — resolution matrix, test coverage map, and known Stage 2 limitation for shaded uber JARs (first pom.properties in zip order; not fixed here)

Tests

Added to test_metadata.bats:

  • get_jar_metadata reads name, version and group from a sibling POM — direct GAV on <project>
  • get_jar_metadata keeps filename pkgname when sibling POM inherits all GAV from parent — parent-only POM, no child artifactId
  • get_jar_metadata resolves child module GAV when sibling POM inherits groupId and version from parent — typical multi-module child shape
    Existing maven structuring / bundle-metadata bats tests continue to pass.

@alexs-aero
alexs-aero marked this pull request as ready for review August 11, 2026 20:53
@alexs-aero
alexs-aero requested a review from a team as a code owner August 11, 2026 20:54
@alexs-aero
alexs-aero force-pushed the fix-673-fix-jar-meta-getter branch from 0e56878 to cee1054 Compare August 24, 2026 17:33
VivekASHub and others added 4 commits August 24, 2026 12:33
…th signatures and checksums

Gradle consumers prefer .module over the Maven POM. deploy-artifacts only uploaded jar/pom (plus .asc and checksums), so published artifacts fell back to POM-only resolution.

Structure and upload .module alongside jar/pom, including .module.asc in build-info and .module.md5/.sha1 without build-info. Keep signed checksums out of JFrog. Sign .module in sign-artifacts and cover the companions in deploy/sign tests.
@alexs-aero alexs-aero changed the title fix: [INFRA-673] Fix Jar properties extraction fix: [INFRA-673] Fix Jar properties extraction and Gradle support Aug 24, 2026
Comment thread .github/workflows/docs/maven_lookup.md
@mcbridem
mcbridem requested a review from a team August 25, 2026 17:31
@alexs-aero
alexs-aero requested a review from mcbridem August 26, 2026 15:49

@mcbridem mcbridem left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@alexs-aero
alexs-aero merged commit 7c8b65d into main Aug 26, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants