Tuesday 22 October 2013

Change a port of the jetty server maven plugin

Below code you need to put inside plugins tag of pom.xml file. which will create a jetty server using maven jetty plugin and will also allow you specify port number instated of using default(8080). 

pom.xml


<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<scanIntervalSeconds>3</scanIntervalSeconds>
<contextPath>/</contextPath>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8090</port>   //put your new port here
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
This code will change the port of your jetty server to 8090 from default port 8080.

please follow the blog if you like it.
Thanks

No comments:

Post a Comment