karma-runner / maven-karma-plugin

Maven plugin for running tests using Karma.
Apache License 2.0
45 stars 26 forks source link

installation of karma via Maven #10

Closed pankajtandon closed 11 years ago

pankajtandon commented 11 years ago

Hi, Any suggestions on how I can install karma via Maven without using npm? Like the maven node plugin (that installs, but does not start :)), is there a way to get maven to install karma also?

And then run it also (via start) like it does now.

kelveden commented 11 years ago

No. The plugin is deliberately very simple in that it essentially just shells out to karma itself. It has been left decoupled from any specific versions of nodejs and karma to allow the user independent control over their own nodejs/karma testing platform.

I'm reluctant to add in such functionality mainly because I don't see a value to it when it can be managed so easily with an 'npm install -g karma'. I also don't like the idea of installing things to the underlying OS - for me that's outside the scope of a build tool like Maven. Following on from that, I imagine that it would be tricky to get such functionality working reliably too given that it would need to be installing stuff to the underlying OS - permissions etc.

Any thoughts? I'd be interested in hearing why you're reluctant to use npm.

ryoungancestry commented 11 years ago

Here is a project that reliably installs node to the maven target directory. If you could also install karma to the same directory via your plugin then there would be no need to install karma manually. Maven should know how to install it's own baggage including node and karma since maven is the build tool. In my mind, you should only have to have maven installed and get the code, and install java and the code should just build. Karma is a test tool and therefore should be part of the maven plugin.

https://github.com/skwakman/nodejs-maven-plugin

eirslett commented 10 years ago

You can use frontend-maven-plugin: https://github.com/eirslett/frontend-maven-plugin With this plugin, you don't even need Node installed on your computer. Maven downloads the Node executable (+npm) into your project, runs npm install for you, and then, in the end, runs karma. Everything local to the project.