Closed emqa closed 11 years ago
Karma is a batch file under Windows? In which case the Karma runner won't work, it needs to execute CMD similar to http://stackoverflow.com/questions/6223765/start-a-java-process-using-runtime-exec-processbuilder-start-with-low-priori
I suggest you submit a patch.
This is a nice start, but we need war overlay support, individual browser configurability, templating and so forth for our team, thanks for the effort!
I have tried editing the line: "final ProcessBuilder builder = new ProcessBuilder("karma", "start", configFile.getAbsolutePath());" to run cmd however when I run mvn install it is still running "karma start c:\angular-phonecat\config\testacular-e2e.conf.js --single-run" as if it is taking the file from somewhere else.
mine works: https://github.com/rvowles/karma-runner-plugin
I created a pull request for this #6
Version 1.1 of the plugin is now up in Maven Central - it includes the pull request from @Nikku. Consequently, am closing this issue.
I keep getting the following error when running the plugin:
DEBUG configFile = c:\angular-phonecat\config\testacular-e2e.conf.js DEBUG singleRun = true DEBUG skipKarma = false [DEBUG] -- end configuration -- karma start c:\angular-phonecat\config\testacular-e2e.conf.js --single-run [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 25.750s [INFO] Finished at: Sun Apr 14 06:53:40 IDT 2013 [INFO] Final Memory: 14M/39M [INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.kelveden:maven-karma-plugin:1.0:start (defaul t) on project maven-karma-plugin: There was an error executing Karma. Cannot run program "karma": CreateProcess error=2, The system cannot find the file specifi ed -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal c om.kelveden:maven-karma-plugin:1.0:start (default) on project maven-karma-plugin : There was an error executing Karma. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:217) 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.buildProje ct(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje ct(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu ild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl eStarter.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(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun cher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav a:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La uncher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java: 352) Caused by: org.apache.maven.plugin.MojoExecutionException: There was an error ex ecuting Karma. at com.kelveden.karma.StartMojo.createKarmaProcess(StartMojo.java:154) at com.kelveden.karma.StartMojo.execute(StartMojo.java:100) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default BuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor .java:209) ... 19 more Caused by: java.io.IOException: Cannot run program "karma": CreateProcess error= 2, The system cannot find the file specified at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) at com.kelveden.karma.StartMojo.createKarmaProcess(StartMojo.java:151) ... 22 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th e file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(ProcessImpl.java:188)
at java.lang.ProcessImpl.start(ProcessImpl.java:132)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 23 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
However when running the following command from command line and not the plugin it runs:
karma start c:\angular-phonecat\config\testacular-e2e.conf.js --single-run I have "karma" and NodeJs in my path