Running JS Tests from Maven
There is Frontend Maven Plugin that can invoke npm commands. Here is an example of project that uses it - this is a demo-project that shows different types of tests, so its configuration is a bit more complicated than usually. This is how you install packages:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.24</version>
<executions>
<execution>
<id>Install NodeJS and NPM</id>
<goals>
<goal>install-node-and-npm</goal>
<goal>npm</goal>
</goals>
<configuration>
<nodeVersion>v0.12.7</nodeVersion>
<npmVersion>2.11.3</npmVersion>
</configuration>
</execution>
</executions>
</plugin>
Running Karma tests:
<execution>
<id>UI Unit Tests</id>
<goals>
<goal>karma</goal>
</goals>
<configuration>
<karmaConfPath>${project.basedir}/src/test/unit-js/karma.conf.js</karmaConfPath>
<skip>${unit.ui.tests.skip}</skip>
</configuration>
</execution>
Running Protractor tests (via npm scripts):
<execution>
<id>UI Component Tests</id>
<goals>
<goal>npm</goal>
</goals>
<phase>test</phase>
<configuration>
<arguments>run component</arguments>
<skip>${component.ui.tests.skip}</skip>
</configuration>
</execution>
Combined Report
The reporting itself is not a part of this plugin. It's your JS frameworks (like Karma, Jasmine) that are responsible for report generation. You can either use xUnit format and let CI (like Jenkins) generate single report out of that. Or use Allure tool that has adaptors for many languages and frameworks (it's relatively easy to write your own if your framework doesn't have the adaptor).