Create the maven project in eclipse

So open eclipse and create a new maven project


Then choose to create a "simple project" and on the next screen use group and artefact Id of "myastronomy", and select packaging of "war":

Click "Finish" to generate the project. Now we need to edit the generated pom.xml file to include milton and to integrate the jetty plugin which we'll use as the embedded web server. So open the pom.xml as "XML file" (if you just open normally you'll get the UI which is difficult to copy and paste).

First we'll add the dependencies which will include milton, so paste this just before the closing project tag:


Then insert the jetty plugin:

                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">

And now add the milton version, and character formatting (its just good practise). You can check the latest milton version on the downloads page:


Now we can add a dependency on the milton runtime. We'll use the community edition which doesnt require registration. We also need to add a slf4 adapter:



And the final result should look like this

IMPORTANT: Check your project preferences and ensure you're using JDK16 or higher (this example uses interface annotations that cause an error on 1.5)

Next Article:

Create the web.xml file