Skip to content
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

If neither of the maven.executable.* settings then mvn is used without resolving via the PATH env var #321

Open
scottkurz opened this issue Jan 31, 2024 · 0 comments

Comments

@scottkurz
Copy link
Member

This is a bit of a subtle point and I'm not sure how much it matters, or if it could even be considered a "good" thing in a way.

The LTV precedence for locating mvn/mvnw executable is:

  1. Look for maven.executable.path setting
  2. Look for maven.executable.preferWrapper setting and if set, look for mvnw
  3. If still not found (whether 2. is set or not), just use 'mvn'.

See:

This is a bit of a difference vs. vscode-maven,
https://github.com/microsoft/vscode-maven/blob/8ee1ef0bbe3810e96c161d0c0e6c7e72c9c54490/src/utils/mavenUtils.ts#L212
which resolves this "mvn" string to the PATH env var... IIUC.

The difference comes into play if you have a shell alias for 'mvn', for example...the LTV way will "work" but the vscode-maven will not.

Like I said.. could this be considered a good thing? Or is it somehow more dangerous to execute an alias? Not sure.

Thought I'd open the issue to make us aware of this in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant