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

Surefire fails with bad message when path contains colon

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • 3.0.0-M1
    • 3.0.0-M4
    • Maven Surefire Plugin
    • None
    • Maven Docker container

    Description

      I noticed that surefire seems not to handle paths like /this is: a test well on mac and linux.

      Steps to reproduce:

      docker run -it --rm maven:3-jdk-8 bash
      root@x:/# mkdir "this is: a test"
      root@x:/# cd this\ is\:\ a\ test/
      root@x:/this is: a test# mvn archetype:generate -B  "-DarchetypeGroupId=com.sap.cloud.s4hana.archetypes" "-DarchetypeArtifactId=scp-cf-spring" "-DarchetypeVersion=2.8.1" "-DgroupId=com.sap.cloud.s4hana.examples" "-DartifactId=my-spring-project" "-Dversion=1.0-SNAPSHOT"
      root@x:/this is: a test/my-spring-project# mvn clean install
      

       
      Result:
       

      Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit4/3.0.0-M1/common-junit4-3.0.0-M1.jar
      Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit3/3.0.0-M1/common-junit3-3.0.0-M1.jar
      Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/3.0.0-M1/common-java5-3.0.0-M1.jar
      Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit3/3.0.0-M1/common-junit3-3.0.0-M1.jar (12 kB at 77 kB/s)
      Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-junit4/3.0.0-M1/common-junit4-3.0.0-M1.jar (28 kB at 168 kB/s)
      Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/surefire/common-java5/3.0.0-M1/common-java5-3.0.0-M1.jar (32 kB at 201 kB/s)
      [INFO]
      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      [INFO]
      [INFO] Results:
      [INFO]
      [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary for my-spring-project - Root 1.0-SNAPSHOT:
      [INFO]
      [INFO] my-spring-project - Root ........................... SUCCESS [  9.569 s]
      [INFO] my-spring-project - Application .................... SUCCESS [01:06 min]
      [INFO] my-spring-project - Unit Tests ..................... FAILURE [ 26.631 s]
      [INFO] my-spring-project - Integration Tests .............. SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  01:46 min
      [INFO] Finished at: 2018-12-17T12:50:32Z
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project my-spring-project-unit-tests: There are test failures.
      [ERROR]
      [ERROR] Please refer to /this is: a test/my-spring-project/unit-tests/target/surefire-reports for the individual test results.
      [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
      [ERROR] ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
      [ERROR] Command was /bin/sh -c cd "/this is: a test/my-spring-project/unit-tests" && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java '-javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/this is: a test/my-spring-project/unit-tests/target/coverage-reports/jacoco.exec' -Xmx1024m -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Djava.io.tmpdir=target/arquillian-working-dir/1/ -jar '/this is: a test/my-spring-project/unit-tests/target/surefire/surefirebooter8095576716546913586.jar' '/this is: a test/my-spring-project/unit-tests/target/surefire' 2018-12-17T12-50-30_752-jvmRun1 surefire1102558004600034061tmp surefire_04747331235585125480tmp
      [ERROR] Error occurred in starting fork, check output in log
      [ERROR] Process Exit Code: 1
      [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
      [ERROR] Command was /bin/sh -c cd "/this is: a test/my-spring-project/unit-tests" && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java '-javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/this is: a test/my-spring-project/unit-tests/target/coverage-reports/jacoco.exec' -Xmx1024m -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Djava.io.tmpdir=target/arquillian-working-dir/1/ -jar '/this is: a test/my-spring-project/unit-tests/target/surefire/surefirebooter8095576716546913586.jar' '/this is: a test/my-spring-project/unit-tests/target/surefire' 2018-12-17T12-50-30_752-jvmRun1 surefire1102558004600034061tmp surefire_04747331235585125480tmp
      [ERROR] Error occurred in starting fork, check output in log
      [ERROR] Process Exit Code: 1
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.awaitResultsDone(ForkStarter.java:511)
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.runSuitesForkPerTestSet(ForkStarter.java:458)
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:299)
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:247)
      [ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
      [ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:991)
      [ERROR] 	at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:837)
      [ERROR] 	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
      [ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
      [ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
      [ERROR] 	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
      [ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
      [ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
      [ERROR] 	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
      [ERROR] 	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      [ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
      [ERROR] 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
      [ERROR] 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
      [ERROR] 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
      [ERROR] 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      [ERROR] 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
      [ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      [ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [ERROR] 	at java.lang.reflect.Method.invoke(Method.java:498)
      [ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      [ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      [ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      [ERROR] 	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      [ERROR] Caused by: org.apache.maven.surefire.booter.SurefireBooterForkException: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
      [ERROR] Command was /bin/sh -c cd "/this is: a test/my-spring-project/unit-tests" && /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java '-javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/this is: a test/my-spring-project/unit-tests/target/coverage-reports/jacoco.exec' -Xmx1024m -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Djava.io.tmpdir=target/arquillian-working-dir/1/ -jar '/this is: a test/my-spring-project/unit-tests/target/surefire/surefirebooter8095576716546913586.jar' '/this is: a test/my-spring-project/unit-tests/target/surefire' 2018-12-17T12-50-30_752-jvmRun1 surefire1102558004600034061tmp surefire_04747331235585125480tmp
      [ERROR] Error occurred in starting fork, check output in log
      [ERROR] Process Exit Code: 1
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:670)
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter.access$600(ForkStarter.java:116)
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter$2.call(ForkStarter.java:445)
      [ERROR] 	at org.apache.maven.plugin.surefire.booterclient.ForkStarter$2.call(ForkStarter.java:421)
      [ERROR] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      [ERROR] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      [ERROR] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      [ERROR] 	at java.lang.Thread.run(Thread.java:748)
      [ERROR]
      [ERROR] -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      [ERROR]
      [ERROR] After correcting the problems, you can resume the build with the command
      [ERROR]   mvn <goals> -rf :my-spring-project-unit-tests
      

      Expectation: If it does not work with such a path (which it should IMO), then at least a better message should be provided. The given message makes it impossible to find the error just by looking at it.

      Attachments

        Issue Links

          Activity

            People

              tibordigana Tibor Digana
              fwilhe Florian Wilhelm
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m