I would like to start and stop jetty with maven.
This is my setup http://nopaste.info/61ef12198d.html
With mvn jetty:run
my jetty starts locally but when I want to run jetty in test-phase with mvn -Pselenium test
jetty doesn't run.
The "Maven way" would be to run your Selenium tests during the integration-test
phase and to start and stop Jetty respectively during the pre-integration-test
and post-integration-test
phases.
There are several ways to implement such a configuration, see Integration and Functional Testing with Maven 2.0 for one approach.
My guess would be that you would have to bind an execution of jetty:run
to a phase that runs before test
. My guess would be process-test-classes
. See Maven Lifecycle Reference .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.