-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mvnd overwrites PATH for vanilla mvn #787
Comments
@gnodet We are receiving complaints from our SDKMAN users that the |
Similar issue happening on homebrew side as well. |
That's a good question. I wonder if |
As an |
I agree that |
@gnodet the problem isn't really with the behaviour of your script, but rather with the fact that your |
Yes, I understood that. That's why I think |
While this is an approach that may work with SDKMAN! (but @marc0der should know much better than I do), I am not sure other package managers (such as Homebrew) support a similar approach. |
Not a homebrew expert, but mvnd formula probably need to declare that it conflicts with maven formula or declare it as keg_only so that it does not try to symlink (=don't try to show up in PATH). What's the benefit of mvnd taking over mvn as a command? |
FWIW, I was hit by #795 because of this overlap/overwrite. |
@famod you will need to open a new terminal to clean up the residual state. Let us know if you still see this entry in your path after doing that. |
@gnodet any update on this yet? I don't think we can advertise mvnd as a Maven distribution because it isn't multiplatform like mvnd. Because this is still causing issues for our users, I'd prefer if we remove 0.9.0 from SDKMAN until this is resolved. |
@famod It might be that you are using a login shell, which means that this problem might persist until you log out and back in again. |
@marc0der all is well with the PS: Sorry for the offtopic spam. |
I personally solved this (hacked?) by removing exec bits from |
@marc0der I'm fine with removing 0.9.0 for now or any other quick fix. Not sure how to do that though. Though I don't understand how the fact that mvnd is multiplatform is relevant. It also works on platforms where the native binary is not available, so this should not be a problem. |
Great, you can remove any version using our API, it has a DELETE method. If you struggle I can help. Also, you would need to make 0.8.9 the new candidate default.
This is very relevant as SDKMAN classifies this at a candidate level. Besides the fact that it simply isn't possible, I also don't feel comfortable adding mvnd to the Maven candidate. |
Done
I've been testing that locally (by using For the platform, I think it would make sense to publish a |
@gnodet I'd prefer it if we do not follow this approach on SDKMAN. Having multiple packages for mvnd will be confusing for our users. I'd like us to keep things as they are (one native package per version per platform). I also do not want the mvnd package to clobber the Maven binary. |
@marc0der So the next Was your objection was related the above point ? Else is there another way that On the |
I use sdkman and both maven (3.9.0) and mvnd (0.8.2, 0.9.0) are installed.
If mvnd 0.9.0 is set as default version, the command "mvn --version" shows the version 3.8.7.
If mvnd 0.8.2 is set as default version, the command "mvn --version" shows the version 3.9.0 (as expected).
The PATH variable looks like:
/Users/henning/.sdkman/candidates/mvnd/current/bin:/Users/henning/.sdkman/candidates/maven/current/bin:...
Since mvnd 0.9.0 the bin-directory contains a 'mvn', which is the first one the shell found. So the 'mvn' from the maven bin-directory is not used.
Is this an issue for mvnd or sdkman? I feel like ordering should not matter for PATH variables.
The text was updated successfully, but these errors were encountered: