This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When NetBeans is installed in an folder containing an "=" maven can not be started. In my case I have NetBeans installed in "C:\\Users\\simon\\AppData\\Local\\0install.net\\implementations\\sha256=9e7a3fbdc0c87b7f12e14529f444345ae709a45310449428026c5257cbb1fc56\\java\\maven\\bin\\mvn.bat" The error message then is "'C:\Users\simon\AppData\Local\0install.net\implementations\sha256' is not recognized as an internal or external command, operable program or batch file." . I think this is because the Maven startup script does not put the filepath in quotes. Therefore Windows can not handle special chars such as spaces and equals signs.
can you reproduce the same behaviour from cmd line? if so, the problem should probably be filed at the maven issue tracking system - http://jira.codehaus.org/browse/MNG
It depends on the way I try to start maven. On the command line it just works when I put the path in quotes, e.g. "C:\\Users\\simon\\AppData\\Local\\0install.net\\implementations\\sha256=9e7a3fbdc0c87b7f12e14529f444345ae709a45310449428026c5257cbb1fc56\\java\\maven\\bin\\mvn.bat" Without the quotes, e.g. C:\\Users\\simon\\AppData\\Local\\0install.net\\implementations\\sha256=9e7a3fbdc0c87b7f12e14529f444345ae709a45310449428026c5257cbb1fc56\\java\\maven\\bin\\mvn.bat the command line returns "'C:\Users\simon\AppData\Local\0install.net\implementations\sha256' is not recognized as an internal or external command, operable program or batch file." . I'm sure NetBeans starts the program without quotes. This must be fixed.
I suppose ShellConstructor.quoteSpaces needs to call Utilities.escapeParameters and also separately escape/quote '=' on Windows (but do nothing special on Unix). Workaround is maybe to run IDE with -J-Dmaven.run.cmd=true (in netbeans.conf).
https://hg.netbeans.org/core-main/rev/6492d0b3a40d = in patch fixed jesse, I didn't completed understand the Utilities.escapeParameters() call, what cases does it cater for? the = in path seemed to get fixed without it..
(In reply to comment #4) > I didn't [completely] understand the Utilities.escapeParameters() call, > what cases does it cater for? the = in path seemed to get fixed without it.. And ' ' as well. escapeParameters would deal with other metacharacters, such as '"' or '\\' (but not '=' since it was designed to be used for argc[1..] rather than argc[0]). IMHO it is a bug in the Windows JRE that argument #0 to ProcessBuilder needs to be escaped; the whole point of passing individual arguments rather than a single parsed String is to avoid the need to escape anything, i.e. bypass shell quoting rules. If someone can explain how Windows deals with metacharacters in commands I would be gratified.
Integrated into 'main-golden', will be available in build *201202220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/6492d0b3a40d User: Milos Kleint <mkleint@netbeans.org> Log: #208065 quote maven path with = character, when executing maven on windows
Created attachment 116066 [details] additonal escaping Jesse, you had something like the attached patch in mind? I'm not feeling entirely positive about escaping some meta chars and then possibly wrapping everything into quotes if = is present..
No, that would not work if you had both ' ' and '=' for example. Possibly escapeParameters should always quote params containing '='?
(In reply to comment #8) > Possibly escapeParameters should always quote params containing '='? Never mind, that would be very annoying for actual parameters, as opposed to the program argc[0].
There are more delimiter characters like ' ' and '='. cmd.exe also regards the following as delimiters (they separate command line arguments): - comma - semicolon - Tab So, these characters would need escaping / quoting too, when handed over to cmd.exe.
http://hg.netbeans.org/core-main/rev/21277ab0917c
Integrated into 'main-golden', will be available in build *201205010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/21277ab0917c User: Milos Kleint <mkleint@netbeans.org> Log: #208065 not only space and = but also ; and , need quoting