## Prerequisites

- JDK 8 or higher
- GlassFish 4.1
- Eclipse Mars(4.5) or higher

## Download

Download the cargo-tracker source code zip file and expand it somewhere in your file system, ideally into ‘/Projects’. Note that this is a Maven project.

## Eclipse Download and Setup Instructions

To download and install Eclipse Mars(latest release as of 2015-09-04), go to the Eclipse project download page.

To the right of the link "Eclipse IDE for Java EE Developers", click the link appropriate to your operating system.

Save the file and unzip to the desired location. Open the newly created folder and create a desktop link to the eclipse executable (eclipse.exe) program.

Open Eclipse and create/select an adequate workspace to import the cargo Tracker project. Close the Welcome page.

In the 'Project Explorer' (if not showing, Window->Show View->Project Explorer), right click and choose Import->Import...

Maven->'Existing Maven Projects'

Browse to the location where you unzipped the cargo-tracker project and click 'Finish'. You should end up with a project in the 'Project Explorer' and warnings in the 'Markers' pane.

### Download and install the Glassfish Plug-ins for Eclipse

Open the 'Servers' view (Window->Show View->Servers) and click the link 'No servers are available.
Click 'Download additional server adapters.

Select GlassFish Tools from the list, Next, Accept the terms of the license agreements.
GlassFish Tools will be downloaded/installed and allow Eclipse to restart when prompted.
In the 'Servers' view (Window->Show View->Servers), again, click the link 'No servers are available to create a new server'.

From the list, expand the GlassFish folder and select GlassFish4, click 'Next.
Assign an admin and server name if desired. Click 'Next'
Define a server root by navigating to the location on your hard drive of the install directory of the GlassFish4.X server that you want to use.
Select the JDK that you want to use. If none are available from the dropdown list, add one through the icon on the right side of the dropdown list. Uncheck any JRE version selected and click 'Add'. Use 'Standard VM' and 'Next'. Select a JDK environment using the 'Directory' button. Click 'Finish'.

Select the newly create JDK link. Select the JDK from the dropdown list. 'Next' Assign a new admin name and password if you want to. 'Finish'.

### Fixing inconsistency between the Build Path and the execution environment

In the 'Project Explorer', right-click the cargo-tracker project, Properties->Java Build Path, Libraries tab.
Select JRE System Library[JavaSE-XX], click Edit...
Select Workspace default JRE (jdk1.x.x_xx), Finish.

Give Eclipse the time to recompile the project.

### Building the project

In the 'Project Explorer', right click on the pom.xml file, Run As->Maven Install

Depending on your machine capabilities, the first build could take some time. On an Intel Core i5 with 32G of RAM, it took just over 6 minutes.

### Starting the GlassFish server and Deploying the cargo-tracker project

On the 'Servers' tab, select your GF server and click the 'Restart' button (green play button).

In the Project Explorer, right-click the cargo-tracker project, 'Run As'->'On server', your GF server should be selected. Check the 'Always use this server when running this project'

The project main page should be available from within Eclipse or you can also access it from an external browser.

There is a tracking interface to track the current status of cargo and a booking interface to book and route cargo. You should explore both interfaces before diving into the code. You should also check out the REST and file processing interfaces to register handling events as well as the HTML5/JavaScript client that uses the REST interface and targets mobile devices. You can test against the REST interfaces using our soapUI tests.