Chapter 3. Your project

3.1. Run your project

Unzip the project, at the root, you should find the pom.xml file. Open it and adjust your database settings exactly as you did during the database extracting process. Again, do not use a production database but a database dedicated to development. Then, from a console, at the root of the project, and still assuming that you are using a postgresql profile, run:

myproject> mvn -Ppostgresql jetty:run

It might be long the first time as Maven will download all the project dependencies, which include Spring jars, Hibernate jars etc... It is a good time to take a short break and enjoy a coffee cup :-)

At the end, once the project is deployed and running on Jetty, you should see an output similar to this screen:

[yourproject] 11:17:31-486 [main] INFO yourpackage.web.listener.StartupListener.contextInitialized(36) | Servlet Context initialized...
2008-11-28 11:17:33.777::INFO: Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server 

3.2. Login

Simply open http://localhost:8080/ and follow your webapp link. You should now see a login page. You can login using user/user or admin/admin. The user cannot see and do much beside login, however the admin has access to all database tables.

3.3. Import your project into Eclipse

The project is ready to be imported as an existing project into Eclipse. Since the project uses Maven 2, make sure you install an eclipse Maven2 plugin.