Depado
Depado

Reputation: 4929

Jetty property daemon seems not to work

I already asked that as a secondary question in another thread, but then it's the only problem remaining.
So, I'm using Maven2 for the continuous integration, and this is how it is working :

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

Except that point that Jetty doesn't start as a daemon, everything's working fine (datasources for jetty, postgresql in the dependencies of the plugin, selenium user-extensions loaded... Thanks guys for all the help you provided me !).

Here is the configuration of my jetty plugin :

<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>

Does anyone knows what I am doing wrong here ?
The Jetty container starts but it blocks everything until I kill it (ctrl+c) and the rest of the lifecycle can't be executed.

Once again, sorry for that repost (I accepted the answer of someone who helped me a lot on my last thread because he deserved it, but no one comes to answer anymore haha), and sorry for my grammar problems xD

Upvotes: 0

Views: 1474

Answers (1)

jesse mcconnell
jesse mcconnell

Reputation: 7182

ok, then I'll answer it with that.

"i would recommend using the jetty-maven-plugin somewhere in the 7.6.x releases versions, 7.6.3.v20120416 being the latest, the plugin you are using is what.. over 4-5 years old I think?"

so after updating your jetty dependencies to newer versions of jetty 7 (for servlet 2.5 support, jetty 8 is servlet 3.0 support) you should also run with the latest org.mortbay.jetty:jetty-maven-plugin:7.6.3.v20120416 when you launching jetty from the maven cli. the maven-jetty-plugin went away years ago because at the time the maven-*-plugin format was ideally the convention for plugins developed by the maven project itself. that convention seems to have gone away over the years though so I regret changing the name a bit in hindsight.

Upvotes: 2

Related Questions