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

Wrong Path Formatting of MAVEN_ARGS variable on Windows #604

Closed
alfeilex opened this issue Sep 10, 2024 · 5 comments · Fixed by #605
Closed

Wrong Path Formatting of MAVEN_ARGS variable on Windows #604

alfeilex opened this issue Sep 10, 2024 · 5 comments · Fixed by #605
Assignees
Labels
bug Something isn't working environment EnvironmentCommandlet, env variables, path, etc. mvn related to apache maven build tool reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented.

Comments

@alfeilex
Copy link
Member

Expected behavior

Environment variables on Windows should be in windows path format:
MAVEN_ARGS=-s C:\projects\dev\conf\mvn\settings.xml

Actual behavior

MAVEN_ARGS=-s /c/projects/dev/conf/mvn/settings.xml is not in windows path format on Windows.

Steps to reproduce (bug)

  1. Install mvn and try to run mvn clean
  2. That error should occur:
ide mvn clean
[ERROR] Error executing Maven.
[ERROR] The specified user settings file does not exist: C:\c\projects\dev\conf\mvn\settings.xml
  1. The reason for that might be the wrong format MAVEN_ARGS value as described in behaviors

Affected version:

  • OS: Windows
  • Shell: GitBash
@alfeilex alfeilex added bug Something isn't working mvn related to apache maven build tool environment EnvironmentCommandlet, env variables, path, etc. labels Sep 10, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Sep 10, 2024
@alfeilex alfeilex self-assigned this Sep 10, 2024
@alfeilex alfeilex moved this from 🆕 New to 🏗 In progress in IDEasy board Sep 10, 2024
@ndemirca
Copy link
Contributor

duplicate of #592

@hohwille
Copy link
Member

hohwille commented Sep 12, 2024

@alfeilex
Why do you think, this is a bug?
Maven is called via mvn.bat on Windows and need a Windows standard PATH rather than a MSYS path.
Is something going wrong with the current state?
IMHO it is a bug to change this...

I was not reading carefully and thought the opposite.

BTW: This is the issue I should have intervented and that caused the problem:
#321

ide mvn clean
[ERROR] Error executing Maven.
[ERROR] The specified user settings file does not exist: C:\c\projects\dev\conf\mvn\settings.xml

OK. I was able to reproduce this. So there is indeed a bug.
Why does that bug occur when maven is called via IDEasy but not when maven is called directly.
Is this actually a bug in MSYS or is there a bug in our code that tries to convert PATH values from MSYS syntax to Windows syntax and produces this C:\c\ path?
Your PR may be valid and fix this, but I still want to really understand what is going wrong here...

UPDATE: I tried to debug this in Intellij and noticed that the error is not reproducible there. So actually a bug of graalvm?

@hohwille
Copy link
Member

duplicate #592

I would disagree. This is a totally different issue.

@hohwille
Copy link
Member

For the record: IMHO this is related to this problem: https://issues.apache.org/jira/browse/MNG-8018

@hohwille
Copy link
Member

Expected behavior
Environment variables on Windows should be in windows path format

This expectation is also wrong. In git-bash we need MSYS path syntax instead of Windows syntax to make it work.
This is the difference of

ide env

called in CMD vs.

ide env --bash

called in git-bash.

As we can see supporting Windows with CMD and git-bash is rather tricky.

@hohwille hohwille added this to the release:2024.09.002 milestone Sep 12, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDEasy board Sep 16, 2024
@jan-vcapgemini jan-vcapgemini changed the title Wrong Path Formating of MAVEN_ARGS variable on Windows Wrong Path Formatting of MAVEN_ARGS variable on Windows Sep 24, 2024
@hohwille hohwille added the reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented. label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working environment EnvironmentCommandlet, env variables, path, etc. mvn related to apache maven build tool reviewed Marks PRs that have been presented in the sprint-review meeting or that do not need to be presented.
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants