Skip to content

BP_JAVA_VERSION with exact patch version (e.g. 17.0.13) silently fails #1338

Description

@stokpop

When BP_JAVA_VERSION is set to an exact patch version like 17.0.13, the Go buildpack does not resolve it correctly.

Root cause: normalizeVersionPattern() in src/java/jres/jre.go appends .* to any string that contains neither + nor *, so "17.0.13" becomes "17.0.13.*". libbuildpack.FindMatchingVersion finds no match for a 4-part wildcard against a 3-part version string, causing an error.

Ruby buildpack behaviour: 17.0.13 was treated as an exact pin and resolved directly.

Affected patterns:

Input Normalized Result
17 17.* ✅ works
17.* 17.* ✅ works
17.0.+ 17.0.* ✅ works
17.0.13 17.0.13.* ❌ no match → error

Fix: In normalizeVersionPattern, detect a fully-qualified version (e.g. 3-part semver with no wildcards) and return it unchanged, or append .* only when the version has fewer than 3 parts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions