Maven Compiler Plugin
  1. Maven Compiler Plugin
  2. MCOMPILER-74

build failure when executable path contains spaces

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:
      windows xp, maven 2.0.9

      Description

      When compiling a project with an executable that has spaces in its path, a build failure is encountered. This can be reproduced by following the exact example given on the Maven Compiler Plugin home page (http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html)

      This seems to be already mentioned in MCOMPILER-30 (which is closed) but there is a comment after it was closed stating it still doesn't work.

      One potential solution I have found is to use version 1.5.1 of plexus-utils - should this be updated in the maven-compiler-plugin's pom or is there a better solution?

      [INFO] -------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Compilation failure
      Failure executing javac, but could not parse the error:
      'C:\Program' is not recognized as an internal or external command,
      operable program or batch file.

      Failure executing javac, but could not parse the error:
      'C:\Program' is not recognized as an internal or external command,
      operable program or batch file.

      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.BuildFailureException: Compilation failure
      Failure executing javac, but could not parse the error:
      'C:\Program' is not recognized as an internal or external command,
      operable program or batch file.

      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
      at java.lang.reflect.Method.invoke(Method.java:391)
      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.CompilationFailureException: Compilation failure
      Failure executing javac, but could not parse the error:
      'C:\Program' is not recognized as an internal or external command,
      operable program or batch file.

      at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:562)
      at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:115)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
      ... 17 more
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 2 seconds
      [INFO] Finished at: Mon May 19 16:54:59 CDT 2008
      [INFO] Final Memory: 6M/19M
      [INFO] ------------------------------------------------------------------------

        Activity

          People

          • Assignee:
            Siveton Vincent
            Reporter:
            Greg Hengeli
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development