Posts

Showing posts with the label plugin

Running multiple test suites using maven-karma-plugin

The maven-karma-plugin allows running your jasmine tests via karma from maven. For the most part, the documentation given in the readme.md at  https://github.com/karma-runner/maven-karma-plugin  is sufficient if you just want to run unit tests using karma. However, if you want to use the karma to run your unit tests as well as your e2e tests, you need to specify it in your pom.xml in a slightly different way. Firstly, the <configuration /> goes inside an <execution /> . Then every <execution /> needs to have an <id /> which should be unique. <plugin>     <groupId>com.kelveden</groupId>     <artifactId>maven-karma-plugin</artifactId>     <version>1.1</version>     <executions>         <execution>             <id>unit</id>             <goals>       ...

Upgrading maven-jetty-plugin for Jetty 8 to use Servlet 3.0

When moving from Jetty 6 to Jetty 8, one of the biggest changes is the jump from Servlet version 2.5 to version 3.0. There is also a change in the JSP version which was 2.0 in Jetty 6.x while it is JSP 2.1 in Jetty 8.x. Keeping that in mind, the dependency for the servlet api needs to be configured to use Servlet 3.0 jars. This should have been sufficient if it wasn't for a change in "maven-jetty-plugin" also. Up to versions 6.x of the maven-jetty-plugin are available under the artifactId of "maven-jetty-plugin". So running, mvn jetty:run with the following in your pom.xml would be sufficient. <plugin>   <groupId>org.mortbay.jetty</groupId>   <artifactId>maven-jetty-plugin</artifactId> </plugin> But if you try to do that with Servlet 3.0, you would end up with a java.lang.ClassNotFoundException for javax.servlet.ServletRegistration$Dynamic.class This is because for jetty 7 and above, the artifactId for the plugin is "jet...