Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2223

Surefire evaluates parameter jvm before skip

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.2.4, 3.2.5
    • Maven Surefire Plugin
    • None

    Description

      Surefire 3.2.3 execution configured like the one bellow will fail if JAVA_11_HOME is not set.

      It is a regression, 2.17 version did correctly resolved skip(Tests) and later, if enabled, it evaluated jvm.

      <execution>
                    <id>h2-java11</id>
                    <goals>
                      <goal>test</goal>
                    </goals>
                    <configuration>
                      <jvm>${JAVA_11_HOME}/bin/java</jvm>
                      <skip>true</skip>
                    </configuration>
                  </execution> 
      fails with
      

      Caused by: org.apache.maven.plugin.MojoFailureException: Given path to java executor does not exist "c:\XXX\${JAVA_11_HOME}\bin\java".
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.getEffectiveJvm (AbstractSurefireMojo.java:2374)
          at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute (AbstractSurefireMojo.java:882)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)

       

       

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              shpelda shpelda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: