Skip to content
buehner edited this page Jun 6, 2014 · 28 revisions

This page describes how you get started with the development of SHOGun2.

It is assumed that you know the basic concepts of this projects design and you are using a Linux-based operating system with a command line interface (CLI). Furthermore, we illustrate the usage of Eclipse with an integrated Tomcat servlet container.

Checking out the sources

At first, you have to check out the sources of SHOGun2:

Go to your (Eclipse-)workspace directory...

$ cd /your/workspace/directory

... and checkout the sources from github:

$ git clone https://github.com/terrestris/shogun2.git

A new folder shogun2 should have been created. Enter the src-folder (which contains the root-pom.xml) in that directory:

$ cd shogun2/src

Building with maven

Execute

$ mvn clean install

to install all SHOGun2-artifacts to your local maven repository.

Using SHOGun2 with Eclipse and an integrated Tomcat

Execute

$ mvn eclipse:clean eclipse:eclipse

to create Eclipse-.project files (and more).

If you open Eclipse now, you can go to File -> Import -> Existing Projects into Workspace and select the shogun2 root-directory (the one you've just checked out from github above).

You now should see some projects that you can import by clicking on Finish import.

In case of a successful import, dependent projects/modules should reference each other, which is very nice, because changes in Module X will immediately be available in any module that depends on Module X. For example, you could check, if the DAO-Project references the Model-project by right-clicking on the DAO-project -> Properties -> Java Build Path. In the Projects-Tab you should see an entry for the shogun2-model-project.

Generate a SHOGun2-based web application

If you have installed the maven artifacts to your local repository, you can create a SHOGun2-based webapp-project by executing the following command (ideally in your workspace directory):

$ mvn archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=de.terrestris -DarchetypeArtifactId=shogun2-webapp-archetype

You will be asked for some values:

  • groupId: Identifies the (web-)project you are about to create. You should use a domain name you control. More info here.
  • artifactId: Name of your artifact without version.
  • version: The version of your artifact.
  • package: The (base) package of your Java classes. You should use a domain name you control.
  • webapp-name: A Name for the webapp you create (Whitespace allowed)

Confirm the creation of the SHOGun2-based webapp by entering Y.

You will now have new folder with the name of the previously entered artifactId. Enter this directory and again, execute:

$ mvn eclipse:clean eclipse:eclipse

In Eclipse, you can import the generated webapp the same way as above:

File -> Import -> Existing Projects into Workspace

In case you have a tomcat integrated in your Eclipse, you can run the (imported) webapp by right-clicking and select Run as -> Run on server. After a few seconds, a simple login form should appear. You can enter any values here to login to the system.