-
Notifications
You must be signed in to change notification settings - Fork 875
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
Use relative wrapper paths to prevent space-in-path bugs #7558
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
The script you point to is no longer even the default wrapper script. Have you checked before and after with the only-script variant too?
Re.: motivation for this PR - both Micronaut Launcher and GDK Launcher (Oracle's work) use an older mvnw to generate the projects, this PR allows NB to work well with those generated projects.
Pls. elaborate ... whta script should be used then ? I've tried to use So if this fix is partial, but working, I'd prefer to merge, and work on an improvement. |
Ah, I understood after looking into the wrapper ;) |
Yes, the default script is now https://github.com/apache/maven-wrapper/blob/master/maven-wrapper-distribution/src/resources/only-mvnw since apache/maven-wrapper#127 although still called Thanks for checking! |
Micronaut developer explained me that they tried new maven wrapper in June and it caused them some serious side effects and issues in eg guides generation. So they rolled back to older version... |
thanks for fixing this. I is just a bit of a shame that workarounds like this one here will have to stick around for a very long time. I think it would be better if IDEs would detect problematic wrapper scripts, notify the user and run |
@mbien file a feature request for that pls... good idea ! |
@sdedic I haven't forgotten about this, i wanted to bring this to the mailing list later between releases, but the recent discussions accelerated it a bit, so I wrote it down right away: https://lists.apache.org/thread/lgfvt0649rlg83j46bcczxj30y87qh95 |
The
mvnw
wrapper contains a subtle bug, which triggers when-running on UNIXes, and
In that case, the wrapper fails to locate its basedir and loops indefinitely, not even launching Maven itself. Regular user just uses
./mvnw
or../mvnw
from the terminal, and is not affected. Sadly NB uses full path to invoke the wrapper.The bug was fixed an year ago in maven-wrapper, line 173 but since the wrapper script is committed in many git repositores, NB should work well even with the buggy version.
This PR relativizes the wrapper path to the execution directoy (either the project dir, or the reactor dir) which works around this bug: one would have to have spaces in path to maven module within the project, which is quite unlikely (and such project would not be usable even from the commandline).