Closed GoogleCodeExporter closed 9 years ago
Thankfully nobody in their right mind uses spaces in a path, especially on a
Mac ;).
Seriously, issue noted/accepted. Low priority (first time I have heard of it),
but
yes should be fixed.
Original comment by charlie....@gmail.com
on 22 Jan 2009 at 12:41
Original comment by charlie....@gmail.com
on 24 Jan 2009 at 11:20
Original comment by charlie....@gmail.com
on 26 Jan 2009 at 11:01
Linux produce the same problem.
Original comment by richard...@cherubim.com.hk
on 31 Mar 2009 at 7:22
Actually, you should use
Runtime.getRuntime().exec(String[] command, String envirionment, File dir)
instead of
Runtime.getRuntime().exec(String command, String envirionment, File dir)
Upon tokenize the parameters in String[] properly, the space problem will be
disappeared and the script will be more portable.
Original comment by richard...@cherubim.com.hk
on 31 Mar 2009 at 8:56
Forgot one point, executing directly without the use of a script is better.
Script
will break easily with path name problem with spaces.
Original comment by richard...@cherubim.com.hk
on 31 Mar 2009 at 9:01
Confirmed, same issue present on Linux. Looks like the "Unix" ProcessBuilder,
which
is trying to account for spaces, fails.
[DEBUG] File '/home/ccollins/projects/simple sample/target/i18n.sh' does not
exsists,
trying to create.
[DEBUG] New file '/home/ccollins/projects/simple sample/target/i18n.sh' created.
[INFO] establishing classpath list (buildClaspathList - scope = COMPILE)
[INFO] google.webtoolkit.home (gwtHome) *not* set, using project POM for GWT
dependencies
[DEBUG] injecting gwt-user and gwt-dev for script classpath from local
repository
(and expecting relative native libs)
[DEBUG] SCRIPT INJECTION CLASSPATH LIST
[DEBUG]
/home/ccollins/.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar
[DEBUG]
/home/ccollins/.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-linux.j
ar
[DEBUG] /home/ccollins/projects/simple sample/src/main/java
[DEBUG] /home/ccollins/projects/simple sample/src/main/resources
[DEBUG] /home/ccollins/projects/simple sample/target/classes
[DEBUG] /home/ccollins/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar
chmod: cannot access `/home/ccollins/projects/simple': No such file or directory
chmod: cannot access `sample/target/i18n.sh': No such file or directory
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Exception attempting to run script - i18n.sh
Embedded error: Cannot run program "/home/ccollins/projects/simple":
java.io.IOException: error=2, No such file or directory
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Exception attempting to
run
script - i18n.sh
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
eExecutor.java:583)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(Def
aultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(Default
LifecycleExecutor.java:924)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecyc
leExecutor.java:767)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
eExecutor.java:529)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(Defaul
tLifecycleExecutor.java:512)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycle
Executor.java:482)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultL
ifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExec
utor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Exception attempting
to
run script - i18n.sh
at com.totsp.mavenplugin.gwt.scripting.ScriptUtil.runScript(ScriptUtil.java:32)
at com.totsp.mavenplugin.gwt.I18NMojo.execute(I18NMojo.java:68)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.ja
va:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycl
eExecutor.java:558)
... 20 more
Caused by: java.io.IOException: Cannot run program
"/home/ccollins/projects/simple":
java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
at java.lang.Runtime.exec(Runtime.java:593)
at java.lang.Runtime.exec(Runtime.java:431)
at
com.totsp.mavenplugin.gwt.scripting.ProcessWatcher.startProcess(ProcessWatcher.j
ava:76)
at
com.totsp.mavenplugin.gwt.scripting.ProcessWatcher.startProcess(ProcessWatcher.j
ava:102)
at com.totsp.mavenplugin.gwt.scripting.ScriptUtil.runScript(ScriptUtil.java:25)
... 23 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or
directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
... 28 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Mar 31 15:00:08 EST 2009
[INFO] Final Memory: 10M/102M
[INFO] ------------------------------------------------------------------------
Original comment by charlie....@gmail.com
on 31 Mar 2009 at 8:01
I had to change several areas in ScriptUtil and UnixScriptWriter, basically to
always
pass arrays to ProcessWatcher (which wraps Runtime.exec - which tokenizes the
input
if you don't pass it an array).
I also had to change the way we quote the classpath in the scripts. This now
works
for me with simple tests on Linux and Mac using spaces.
Giant pain in the ass though, worked on the spaces thing for 3 hours today,
thought
it would be simple, thought wrong. ;)
Original comment by charlie....@gmail.com
on 1 Apr 2009 at 12:24
In 2.0-RC1.
Original comment by charlie....@gmail.com
on 3 Apr 2009 at 1:16
Original issue reported on code.google.com by
joe.cul...@gmail.com
on 16 Jan 2009 at 9:33