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.
All Maven builds within NetBeans 6.5 result in the same exception: java.io.IOException: CreateProcess error=5, Access is denied at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) at java.lang.ProcessImpl.start(ProcessImpl.java:30) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) Caused: java.io.IOException: Cannot run program "C:\java\lib\apache-maven-2.0.9\bin\mvn.bat" (in directory "C:\code\project\trunk\"): CreateProcess error=5, Access is denied at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:158) [catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151) Running mvn using the same directories from the command-line (logged on as the same user) works just fine.
googling for http://www.google.de/search?q=CreateProcess+error%3D5%2C+Access+is+denied suggests it's a problem with access rights given either to the user account or the maven executable. I suspect it runs from command line because you have correct rights for the shell executable.
have you been able to get around the issue? can you share with others how the workaround works and what was the cause if the issue? thanks.
It appears that the problem is that the java CreateProcess API can't run a *.bat file - it needs an executable. For example, if I could change it to use "cmd.exe C:\java\lib\apache-maven-2.0.9\bin\mvn.bat", I would - from what I've read, that should work; but the validation won't let me use such a value. The workaround is to manually modify every project to use embedded Maven (unfortunately there's no longer a global setting for this) - which is working fine so far. (the most recent versions of the Maven plugin on NB 6.1 weren't working for me due to a known bug in the Maven embedder.) However, I would prefer to be able to use either, since I've found embedded Maven to be flakier than command-line Maven. Thanks --john
hmm... the non-cmd version seems to work for most people. But I suppose it won't hurt if we use it by default on windows, correct?
pushed to maven-dev repository http://hg.netbeans.org/maven-dev/rev/c18222aa460a to be pushed to main repository sometimes this week. juhrik: can you please test on various windows based setups that the change build execution works?
Integrated into 'main-golden', will be available in build *200811281401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/c18222aa460a User: Milos Kleint <mkleint@netbeans.org> Log: #153101 for windows execution, use "cmd /c mvn.bat"
the fix for this issue introduced other problems with space in path. eg. http://www.netbeans.org/issues/show_bug.cgi?id=164234 http://hg.netbeans.org/main/rev/7e4af1007d3c the new code will not use the cmd /c workaround initially, just fallback to it once the problem described in this issue arises. you can switch to the cmd /c execution permanently by adding -J-Dmaven.run.cmd=true to your etc/netbeans.conf. It woudl be great if you could test on your setup (i've just tried to simulate it), it should appear in the next few days in the daily development builds. thanks.
I'm no longer seeing this problem on Windows, using Windows Vista and a newer version of the JVM: NetBeans: Executing 'mvn.bat clean install' NetBeans: JAVA_HOME =C:\java\jdk1.6.0_13 Scanning for projects... ------------------------------------------------------------------------ Building Logging task-segment: [clean, install] ------------------------------------------------------------------------ [clean:clean] Deleting file set: C:\code\common\log\trunk\log\target (included: [**], excluded: []) [enforcer:enforce {execution: enforce-versions}] [resources:resources] Using 'UTF-8' encoding to copy filtered resources. ... Most likely I'm no longer seeing this problem b/c Microsoft changed The CreateProcess API in Vista. It's less likely that Sun changed their implementation. I would think spaces in parameters should always cause the parameter to be wrapped with quotes, whether it's after "cmd /c" or not.
Integrated into 'main-golden', will be available in build *200905090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/7e4af1007d3c User: Milos Kleint <mkleint@netbeans.org> Log: #164234, #153101 quote property values containing spaces on windows, use cmd /c for execution only if failing without it. cmd /c has negative effect of quoting property values
some more space in path problems here: http://www.netbeans.org/issues/show_bug.cgi?id=164986 I've fixed them for the non-cmd version of execution. please verify it also works for the cmd /c alternative. If not, it would be great if you could try tweaking the http://hg.netbeans.org/main/file/58e767a34c9d/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java execution wrapper and see what works. Thanks.