Cómo ejecutar diferentes proyectos web en un puerto con Jetty

I have a question about Maven.it's very easy to use Maven+Jetty . If anyone know how to run different web projects in one port with Jetty ? I need to use Jetty ,realize the function that can support hot code and debug project at the same time.

preguntado el 24 de agosto de 12 a las 10:08

1 Respuestas

Suppose the structure is

principal

l_ main-a

l_ main-b

and the main-a is the main module.main-b is for simulating static resource service.you can run two web apps in jetty.

You can deploy jetty in main-a,and after the main-a is done ,then upload main-b

the Xml code:

<plugin>    
<groupId>org.mortbay.jetty</groupId>    
<artifactId>maven-jetty-plugin</artifactId>    
<configuration>    
    <webApp>${basedir}/target/main-a</webApp>    
    <scanIntervalSeconds>10</scanIntervalSeconds>    
    <contextPath>/main-a</contextPath>    
    <contextHandlers>    
        <contextHandler implementation="org.mortbay.jetty.webapp.WebAppContext">    
            <war>${project.parent.basedir}/main-b/target/main-b.war</war>    
            <contextPath>/main-b</contextPath>    
        </contextHandler>    
    </contextHandlers>    
</configuration>    

then after main-b generate the war package,execute mvn jetty:run in main-a .then you can run main-a and main-b with jetty at the same time.

Respondido 27 ago 12, 04:08

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.