Pages

Jetty | Define context path and port

Jetty default, runs on the port 8080 and no context path. Well, while developing projects, we often want to define context path and some other port to occupy. Here's how we could do it.

          <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <configuration>
                    <webApp>
                        <contextPath>/custom-path</contextPath>
                    </webApp>
                    <connectors>
                        <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>PLACEHOLDER_CAS_HTTP_PORT</port>
                        </connector>
                    </connectors>
                    <stopPort>PLACEHOLDER_CAS_STOP_PORT</stopPort>
                    <stopKey>foo</stopKey>
                </configuration>
            </plugin>

No comments:

Post a Comment

If you like to say anything (good/bad), Please do not hesitate...