0

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

Depado
  • 4,811
  • 3
  • 41
  • 63
  • 1
    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? – jesse mcconnell May 10 '12 at 12:36
  • In fact you were right, but your confusing the version of jetty and the version of the maven-jetty-plugin. I had the old version of mortbay (before eclipse got jetty) in my dependencies, that's why it doesn't worked. Thanks for your help :) – Depado May 10 '12 at 13:05

1 Answers1

2

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.

jesse mcconnell
  • 7,102
  • 1
  • 22
  • 33
  • As I commented it worked, though the maven-jetty-plugin is still at the same version than before. I just got the latest jetty-server in my dependencies. It seems that since Eclipse are the maintainers of the project, they added the `` property that's why it was ignored with my very old version. =) Thanks a lot for your help =) – Depado May 10 '12 at 15:06
  • well, eclipse isn't the maintainers, the jetty project is still composed of the same folks. The project itself is really split between eclipse and codehaus, where codehaus contains the things that would be problematic or difficult to get through the eclipse IP process. so the guts of the project are at eclipse and the integrations and stuff like that are still at codehaus. We have talked about bringing the maven plugins over but there would be packaging changes, etc etc and its just not compelling atm. anyway, glad you got it working – jesse mcconnell May 10 '12 at 15:08