GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Epic: Infer Java version/distribution from project files (.sdkmanrc, asdf, pom.xml, build.gradle) · Issue #1048 · actions/setup-java

Epic: Infer Java version/distribution from project files (.sdkmanrc, asdf, pom.xml, build.gradle) #1048

New issue
Copy link
New issue
Copy link
Closed
Feature
Closed
Epic: Infer Java version/distribution from project files (.sdkmanrc, asdf, pom.xml, build.gradle)#1048
Feature
Copy link
Labels
distributionJDK distribution/version/source supportfeature requestNew feature or request to improve the current logic

Description

@brunoborges
brunoborges
opened on Jun 23, 2026
Issue body actions

Epic: Infer Java version and/or distribution from project files

Several open requests ask setup-java to read the Java version and/or distribution from an existing project/tooling file instead of (or in addition to) the java-version / distribution inputs. They share one design space — "resolve setup inputs from a file on disk" — so this epic tracks them together to keep behavior, precedence, and the java-version-file input consistent across formats.

Today's baseline

java-version-file already supports .java-version and reading java.version from pom.xml / build files in some cases. The items below extend the set of recognized files and add distribution detection.

Sub-requests

  • Support extracting Java version from pom.xml and build.gradle via java-version-file #1034 — Extract Java version from pom.xml and build.gradle via java-version-file
  • Specify distribution via java-version-file #646 — Specify the distribution via java-version-file (not just the version)
  • Parse Java distribution from .sdkmanrc #971 — Parse Java distribution from .sdkmanrc · implemented by PR feat: Add distribution detection support to .sdkmanrc file #975
  • Parse distribution from ASDF #738 — Parse distribution from ASDF (.tool-versions) · implemented by PR Infer distribution from asdf .tool-versions vendor prefix #1084 (merged)

Cross-cutting design questions

  • Precedence when multiple sources are present (explicit input vs file vs multiple files).
  • Whether a single java-version-file input auto-detects format, or distinct inputs per source.
  • How distribution names in third-party files (SDKMAN!, asdf) map to setup-java distribution IDs.
  • Behavior when a file specifies a distribution setup-java doesn't support.

Notes

This epic is for coordination/visibility — the individual issues remain open and can be implemented independently. PR #975 already covers the .sdkmanrc slice (#971).

Activity

  1. brunoborges
    added
    feature requestNew feature or request to improve the current logic
    distributionJDK distribution/version/source support
    on Jun 23, 2026
  2. brunoborges
    added the
    Feature
    issue type on Jun 23, 2026
  3. hupling commented on Jul 9, 2026

    @hupling
    hupling
    on Jul 9, 2026
    More actions

    for pom.xml

            <java.version>21</java.version>
            <maven.compiler.source>${java.version}</maven.compiler.source>
            <maven.compiler.target>${java.version}</maven.compiler.target>
            <maven.compiler.release>${java.version}</maven.compiler.release>

    there you could add here.

    https://github.com/actions/setup-java/blob/main/src/util.ts#L160

    } else if (versionFileName == 'pom.xml') {
        javaVersionRegExp = /(?<java.version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
    }
  4. brunoborges commented on Jul 9, 2026

    @brunoborges
    brunoborges
    on Jul 9, 2026
    ContributorAuthor
    More actions

    @hupling please see my comment in the actual issue

  5. brunoborges
    closed this as completedon Jul 9, 2026
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

    distributionJDK distribution/version/source supportfeature requestNew feature or request to improve the current logic

    Type

    Feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.