I am still having problems how to configure jetty plugin in Maven to be able to start it run test using maven-surefire-plugin and then stop jetty server. So far it just run jetty and waits and it does not continue. Another issue is when the plugin should be jetty-maven-plugin or maven-jetty-plugin. I do not a difference between them. Anyway here an excerpt from my pom.xml.
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<!--version>9.2.11.v20150529</version-->
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webApp>
<contextPath>/hellojavaworld</contextPath>
</webApp>
<war>c:\apache-tomcat-7.0.64\webapps\hellojavaworld.war</war>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<!--configuration>
<daemon>true</daemon>
</configuration-->
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<excludes>
<exclude>*.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>*.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
In the console is just:
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.
I want it to start jetty, run test (servlet container required), stop jetty and write BUILD SUCCESSFUL.
Does anybody have any suggestion? Thanks in advance.