title: Why can't the system find the path specified when building project with Maven?
body: <p>I am trying to start a Groovy/Java project from scratch. I have created a Groovy class with a test. </p>
  
  <p>When building, I am getting the following error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project repository: Compilation failure
  [ERROR] Failure executing groovy-eclipse compiler:
  [ERROR] The system cannot find the path specified.
  [ERROR] -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on projec
  t repository: Compilation failure
  Failure executing groovy-eclipse compiler:
  The system cannot find the path specified.
  
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
          at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
  Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
  Failure executing groovy-eclipse compiler:
  The system cannot find the path specified.
  
          at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)
          at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
          ... 19 more
  </code></pre>
  
  <p>I have run Process monitor to see what path's it could not find and is says the following:</p>
  
  <pre><code>D:\Programmeren\Workspace\BirthdayAppV2\JAVA_HOME\bin\
  D:\Programmeren\Workspace\BirthdayAppV2\ GROOVY_HOME\bin\
  D:\Programmeren\Workspace\BirthdayAppV2\domain\${env.JAVA_HOME_7}\bin\javac
  D:\Programmeren\Workspace\BirthdayAppV2\domain\${env.JAVA_HOME_7}\bin\
  </code></pre>
  
  <p>It seems maven isn't using my JAVA_HOME variables correctly.</p>
  
  <p>Does someone have a solution to this problem?</p>
  
  <p>This is my main pom:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;be.vandevelde.glenn&lt;/groupId&gt;
  &lt;artifactId&gt;BirthdayAppV2&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;pom&lt;/packaging&gt;
  
  &lt;name&gt;BirthdayManagerV2&lt;/name&gt;
  
  &lt;properties&gt;
      &lt;java.version&gt;1.7&lt;/java.version&gt;
      &lt;spring.version&gt;3.2.2&lt;/spring.version&gt;
      &lt;groovyVersion&gt;2.1.3&lt;/groovyVersion&gt;
  &lt;/properties&gt;
  
  &lt;modules&gt;
      &lt;module&gt;repository&lt;/module&gt;
      &lt;module&gt;domain&lt;/module&gt;
  &lt;/modules&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.8.2&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.spockframework&lt;/groupId&gt;
          &lt;artifactId&gt;spock-core&lt;/artifactId&gt;
          &lt;version&gt;0.7-groovy-2.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
          &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
          &lt;version&gt;${groovyVersion}&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;compilerId&gt;groovy-eclipse-compiler&lt;/compilerId&gt;
                  &lt;!-- set verbose to be true if you want lots of uninteresting messages --&gt;
                  &lt;!-- &lt;verbose&gt;true&lt;/verbose&gt; --&gt;
              &lt;/configuration&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                      &lt;artifactId&gt;groovy-eclipse-compiler&lt;/artifactId&gt;
                      &lt;version&gt;2.7.0-01&lt;/version&gt;
                  &lt;/dependency&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                      &lt;artifactId&gt;groovy-eclipse-batch&lt;/artifactId&gt;
                      &lt;version&gt;2.1.3-01&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
              &lt;artifactId&gt;groovy-eclipse-compiler&lt;/artifactId&gt;
              &lt;version&gt;2.7.0-01&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;build-helper-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.5&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;add-source&lt;/id&gt;
                      &lt;phase&gt;generate-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;add-source&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;sources&gt;
                              &lt;source&gt;src/main/groovy&lt;/source&gt;
                          &lt;/sources&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;id&gt;add-test-source&lt;/id&gt;
                      &lt;phase&gt;generate-test-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;add-test-source&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;sources&gt;
                              &lt;source&gt;src/test/groovy&lt;/source&gt;
                          &lt;/sources&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;${java.version}&lt;/source&gt;
                  &lt;target&gt;${java.version}&lt;/target&gt;
                  &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                  &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                  &lt;executable&gt;${env.JAVA_HOME_7}/bin/javac&lt;/executable&gt;
                  &lt;fork&gt;true&lt;/fork&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>