You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No way to configure maven version in actions/setup-java #457
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:
Reacted by Max Rydahl Andersen, Marco Bungart, Peter, Wolf2323, Marcel D. Juhnke, Henrik Jürges, Kesu, Marcel Lorke, Joe Littlejohn, Volodya Lombrozo and 15 more
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.
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).
Reacted by Patryk Miszczak, Marcus Hirt, Stefan Bischof and Laird Nelson
@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.
Activity
IvanZosimov commentedon Mar 3, 2023
Hi, @ichinna 👋 Thanks for the issue, we will take a look at it and get back to you with updates.
maxandersen commentedon Mar 3, 2023
+1 on this as it is a regular occurrence that maven minor updates does break things faster than plugin can get updates.
karussell commentedon Mar 3, 2023
There is already some discussion here: https://github.com/orgs/community/discussions/49001
This issue here seems to be a duplicate of #40
maxandersen commentedon Mar 3, 2023
#40 indicates maven is not being provided by setup-java thus they won't add config for it ? Not following how that works.
joelittlejohn commentedon Mar 4, 2023
As a workaround, I've switched to using https://github.com/s4u/setup-maven-action. Here's an example:
vorburger commentedon Mar 6, 2023
I don't think
setup-javashould 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.propertiesfile, and then launchingrun: ./mvnwinstead ofmvn?dmitry-shibanov commentedon Mar 16, 2023
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.
workaround?
Andreiasilva1 commentedon Jun 13, 2023
Abrir
Remove Java 8 GH action build
rmannibucau commentedon May 13, 2024
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).
Use s4u/setup-maven-action instead
damianszczepanik commentedon Jan 19, 2025
There is another way to configure which maven you should be used for the build https://github.com/marketplace/actions/setup-maven
vorburger commentedon Jan 19, 2025
I would be very carefully evaluating that fork, before using it, if I were you.
Mailaender commentedon Jan 7, 2026
There is also https://github.com/sdkman/sdkman-action as an alternative.
rmannibucau commentedon Jan 7, 2026
@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.