You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "sdedic (via GitHub)" <gi...@apache.org> on 2024/07/10 10:37:50 UTC
[PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
sdedic opened a new pull request, #7558:
URL: https://github.com/apache/netbeans/pull/7558
The `mvnw` wrapper contains a subtle bug, which triggers when
-running on UNIXes, **and**
- there's a space in the project path, **and**
- wrapper is invoked using full path
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](https://github.com/apache/maven-wrapper/commit/7840c9036eb6e082f53ff6c18c87c82e21819e02#diff-9f09d06998a17f35256c5fe39732f2acd724bde0eb02e2cff65479ff55e53170L173) 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).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2220517117
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 `wrapper:wrapper` if the user gives the OK. This would remove the need for workarounds and also help users to fix issues in their repos - that is what IDEs are for IMO.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2220539830
@mbien file a feature request for that pls... good idea !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2220285877
Yes, the default script is now https://github.com/apache/maven-wrapper/blob/master/maven-wrapper-distribution/src/resources/only-mvnw since https://github.com/apache/maven-wrapper/pull/127 although still called `mvnw`.
Thanks for checking!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2220278927
Ah, I understood after looking into the wrapper ;)
Yes, the new wrapper version that `wget`-downloads the distribution works even with the original MavenCommandLineExecutor and does not break with this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2289947623
> @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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2220254838
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.
>
> 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?
Pls. elaborate ... whta script should be used then ? I've tried to use `mvn wrapper:wrapper` (maven 3.9.8) and still `mvnw` in the project root seems to be the one.
So if this fix is partial, but working, I'd prefer to merge, and work on an improvement.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "sdedic (via GitHub)" <gi...@apache.org>.
sdedic merged PR #7558:
URL: https://github.com/apache/netbeans/pull/7558
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Use relative wrapper paths to prevent space-in-path bugs [netbeans]
Posted by "MartinBalin (via GitHub)" <gi...@apache.org>.
MartinBalin commented on PR #7558:
URL: https://github.com/apache/netbeans/pull/7558#issuecomment-2220334694
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...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists