Jetty属性守护程序似乎不起作用

时间:2012-05-10 07:16:48

标签: maven jetty daemon maven-jetty-plugin

我已经在另一个帖子中将其作为次要问题,但那是剩下的唯一问题 所以,我正在使用Maven2进行持续集成,这就是它的工作原理:

1. Unit test the server side   
2. Build the application  
3. Build the war  
4. Start a Jetty container => Blocks everything  
5. Start a Selenium server   
6. Unit test the client side   
7. Close the Selenium server   
8. Close the Jetty container

除了Jetty没有作为守护进程启动之外,一切正常(jetty的数据源,插件的依赖项中的postgresql,加载的selenium用户扩展...感谢各位帮助你提供了我!)

以下是我的jetty插件的配置:

<plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.9</version>
            <executions>
                <execution>
                    <id>start-jetty</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <daemon>true</daemon>
                        <contextPath>agepro-prototype</contextPath>
                        <webApp>${project.build.directory}/agepro-prototype.war</webApp>
                    </configuration>
                </execution>
                <execution>
                    <id>stop-jetty</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <connectors>
                    <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                        <port>9091</port> 
                    </connector>
                </connectors>
                <stopPort>9092</stopPort>
                <stopKey>test</stopKey>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>9.1-901.jdbc4</version>
                </dependency>
            </dependencies>
        </plugin>

有谁知道我在这里做错了什么? Jetty容器启动但它会阻止所有内容,直到我杀死它(ctrl + c)并且生命周期的其余部分无法执行。

再一次,抱歉转发(我接受了一个在我最后一个帖子上帮助了我很多人的答案,因为他应得的,但是没有人再来回答了哈哈),对不起我的语法问题的xD

1 个答案:

答案 0 :(得分:2)

好的,那我就回答一下。

“我建议在7.6.x版本的某个地方使用jetty-maven-plugin,7.6.3.v20120416是最新的,你使用的插件是什么...我认为4-5岁了? “

所以在将jetty依赖项更新到较新版本的jetty 7(对于servlet 2.5支持,jetty 8是servlet 3.0支持)之后,你还应该运行最新的org.mortbay.jetty:jetty-maven-plugin:7.6.3 .v20120416当你从maven cli发射码头时。 maven-jetty-plugin几年前就消失了,因为当时maven - * - plugin格式理想地是maven项目本身开发的插件的惯例。多年来,这个惯例似乎已经消失了,所以我很遗憾在后见之明改变这个名字。

相关问题