Skip to content

No way to configure maven version in actions/setup-java  #457

Closed as not planned

Description

@ichinna

Description:
Maven @3.9.0 introduced plugin breakage. And I don't see a way I can use a particular version of maven with setup-java GitHub Actions. So, can you provide information on how to use/configure a particular version when I use actions/setup-java in a GitHub pipeline? For reference look at this Maven changelog

Task version:
v1 v2 v3 (All versions)

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Try to use a maven plugin in your pom.xml. And when running it using maven@3.9.0, it fails to download that plugin.

Expected behavior:
A way to configure a particular version of maven in actions/setup-java@v*

Actual behavior:

Activity

  1. IvanZosimov commented on Mar 3, 2023

    @IvanZosimov
    Contributor

    Hi, @ichinna 👋 Thanks for the issue, we will take a look at it and get back to you with updates.

  2. maxandersen commented on Mar 3, 2023

    @maxandersen

    +1 on this as it is a regular occurrence that maven minor updates does break things faster than plugin can get updates.

  3. karussell commented on Mar 3, 2023

    @karussell

    There is already some discussion here: https://github.com/orgs/community/discussions/49001

    This issue here seems to be a duplicate of #40

  4. maxandersen commented on Mar 3, 2023

    @maxandersen

    #40 indicates maven is not being provided by setup-java thus they won't add config for it ? Not following how that works.

  5. joelittlejohn commented on Mar 4, 2023

    @joelittlejohn

    As a workaround, I've switched to using https://github.com/s4u/setup-maven-action. Here's an example:

          - name: Setup Maven Action
            uses: s4u/setup-maven-action@v1.7.0
            with:
              checkout-fetch-depth: 0
              java-version: 8
              java-distribution: temurin
              maven-version: 3.8.7
  6. vorburger commented on Mar 6, 2023

    @vorburger

    I don't think setup-java should set up Maven.

    But perhaps you would like to consider using https://maven.apache.org/wrapper/ and fixing the Maven version your project requires in a maven-wrapper.properties file, and then launching run: ./mvnw instead of mvn?

  7. dmitry-shibanov commented on Mar 16, 2023

    @dmitry-shibanov
    Contributor

    Hello everyone. Thank you for your report. Unfortunately we're not planing to add configuration options for Maven to setup-java. The solution can be to use community action to change Maven version or use Maven Wrapper. Maven version was changed to 3.8.7 on images. For now I'm going to close the issue.

  8. added a commit that references this issue on Mar 26, 2023
  9. Andreiasilva1 commented on Jun 13, 2023

    @Andreiasilva1

    Abrir

  10. added a commit that references this issue on Apr 18, 2024
  11. rmannibucau commented on May 13, 2024

    @rmannibucau

    Any hope it gets fixed, if you consider the java version is important, maven is likely on the same kind of prerequisite and using none official actions is never nice?

    side note: wrapper is indeed not an option (pollutes the project, requires more work for matrix testing + no real reason since it is a runner responsability to setup the right tool when using this kind of action IMHO).

  12. added a commit that references this issue on Jul 2, 2024
  13. damianszczepanik commented on Jan 19, 2025

    @damianszczepanik

    There is another way to configure which maven you should be used for the build https://github.com/marketplace/actions/setup-maven

    - uses: stCarolas/setup-maven@v5
      with:
        maven-version: 3.9.9
    
  14. vorburger commented on Jan 19, 2025

    @vorburger

    uses: stCarolas/setup-maven@v5

    I would be very carefully evaluating that fork, before using it, if I were you.

  15. Mailaender commented on Jan 7, 2026

    @Mailaender

    There is also https://github.com/sdkman/sdkman-action as an alternative.

  16. rmannibucau commented on Jan 7, 2026

    @rmannibucau

    @Mailaender sdkman is not great cause versions are not immutable and can be deleted anytime so better to not use it on CI in favor of a central based impl.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions