{title:'Jetty.xml file', created:'8.0.0'}

The Jetty microservice comes with a bare-bones jetty.xml file which can be modified to suite any needs.

The jetty.xml can be located in either the "." or "files" working directory or classpath. It can also be specified in any of the following ways:

SVL variables in the jetty.xml file are automatically resolved by the microservice. This allows you to reference values in your configuration file from the jetty.xml file.

The HTTP port used is controlled via the following:

The first available port is then made available through the system property "availablePort" so that it can be referenced in our jetty.xml file.

| <Set name="connectors"> | <Array type="org.eclipse.jetty.server.Connector"> | <Item> | <New class="org.eclipse.jetty.server.ServerConnector"> | <Arg> | <Ref refid="ExampleServer" /> | </Arg> | <Set name="port">$S{availablePort,8080}</Set> | </New> | </Item> | </Array> | </Set>

The {@link oaj.microservice.jetty.JettyMicroservice.Builder#jettyServerFactory(JettyServerFactory)} method is also provided to use your own customized Jetty server.