I am using jetty maven plugin to deploy some wars.
I have 2 modules:
moduleA.war at port 8180
moduleB.war at port 8380
When I deploy the war using the maven jetty plugin, both webapps are trying to run at port 8180 even though I am setting up connectors for both application. Here is my pom configuration for doing this:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.1.3.v20100526</version>
<configuration>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8180</port>
<name>instance_8180</name>
</connector>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8380</port>
<name>instance_8380</name>
</connector>
</connectors>
<contextHandlers>
<!-- <contextHandler implementation="org.mortbay.jetty.plugin.JettyWebAppContext"> -->
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>/${project.build.directory}/user-mgmt-web-1.0-SNAPSHOT.war</war>
<contextPath>/user-mgmt-web</contextPath>
<connectorNames>
<item>instance_8180</item>
</connectorNames>
</contextHandler>
<!-- <contextHandler implementation="org.mortbay.jetty.plugin.JettyWebAppContext"> -->
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<war>/${project.build.directory}/services-web-1.0-SNAPSHOT.war</war>
<contextPath>/services-web</contextPath>
<connectorNames>
<item>instance_8380</item>
</connectorNames>
</contextHandler>
</contextHandlers>
<stopPort>80</stopPort>
<stopKey>stop</stopKey>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>stop</goal>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
I would like to know how to make the second webapp deployed start at its assigned port.
When I run it, when the container finishes initializing the second webapp, i get an address already in use error.
Assane
I think two different module with two different port works only in multiple instance,In your case only first port no is activated set idle timeout for first port.
Then start another port.
If above not work try this one below
In your jetty.xml add new connector