简体   繁体   English

如何用maven开始和停止码头

[英]How to start and stop jetty with maven

I would like to start and stop jetty with maven. 我想用maven开始和停止码头。

This is my setup http://nopaste.info/61ef12198d.html 这是我的设置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. 使用mvn jetty:run我的jetty在本地启动但是当我想在测试阶段使用mvn -Pselenium test运行jetty时mvn -Pselenium test jetty不会运行。

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. “Maven方式”是在integration-test阶段运行Selenium测试,并在pre-integration-testpost-integration-test阶段分别启动和停止Jetty。

There are several ways to implement such a configuration, see Integration and Functional Testing with Maven 2.0 for one approach. 有几种方法可以实现这样的配置,有关一种方法,请参阅使用Maven 2.0进行集成和功能测试

My guess would be that you would have to bind an execution of jetty:run to a phase that runs before test . 我的猜测是你必须绑定jetty:run的执行jetty:runtest之前jetty:run的阶段。 My guess would be process-test-classes . 我的猜测是process-test-classes See Maven Lifecycle Reference . 请参阅Maven生命周期参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM