Locked History Actions

deegree3/HowToSetupDeegree3InEclipse

How to set up deegree 3 in Eclipse

1. Requirements

To create a working deegree 3 workspace in eclipse, make sure your system meets the following requirements:

  • Eclipse EE (Eclipse IDE for Java EE Developers )
  • Oracle Java 1.6+ (JDK)
  • Maven 3

2. git checkout

At first, clone the git repository.
You can choose the location of the checkout freely.
The later to be created workspace will be linked to the checkout directory (e.g. /home/user/d3-checkout).

We recommend to checkout the deegree 3 master via following console command:

Anonymous access

git clone git://github.com/deegree/deegree3.git

Developer access

git clone git@github.com:deegree/deegree3.git

3. Create a new Eclipse workspace

It is recommended to create a new workspace in eclipse.
There will be a lot of deegree modules listed in the chosen workspace.
If you don't mind that fact, you can use your existing workspace.

To create a new workspace open eclipse.

Afterwards select "File" ==> "Switch workspace" ==> "Other" ==> Select the new workspace path (e.g. /home/user/d3-workspace)==> Hit "Ok".
(Keep in mind that the workspace directory and the eclipse workspace are two different directories).

Close eclipse.

4. Prepare Maven project

Switch to your deegree 3 checkout directory (e.g. /home/user/d3-checkout/trunk).

Run the following command via console:

mvn eclipse:clean eclipse:eclipse eclipse:configure-workspace deegree:eclipse -Dwtpversion=2.0 -DdownloadSources=true -DdownloadJavadocs=true -Declipse.workspace=/home/user/d3-workspace/

Adjust the -Declipse.workspace property to match your chosen workspace. It is recommended have eclipse closed while this process takes place.

4.1. Explanation of the used Maven plugins and goals

  • eclipse:clean eclipse:eclipse: downloads all dependencies, configures the eclipse project
  • eclipse:configure-workspace: configures eclipse with the classpath variable M2_REPO
  • -DdownloadSources/downloadJavadocs: also download source/javadoc .jars to get Sources and Javadocs in eclipse
  • -Dwtpversion=2.0: enable the deegree webapp projects to be recognized as such
  • deegree:eclipse: configures the Java source formatter for eclipse, configures certain XML settings to minimize warnings/errors, configures the deegree headers/file templates

5. Import project to Eclipse

Start eclipse.

  • Select "File" ==> "Import" ==> "General" ==> "Existing projects into workspace" ==> Select your checkout directory ==> "Finish".

  • Configure your name/email address in the new file templates.

That is it. You are done.

For better overview, it's recommended to configure some working sets (eg. d3-core) to group projects/modules.

6. Troubleshooting

If you still have a lot of errors in the project try the following steps:

  • Delete the project
  • Close eclipse
  • Go to the checkout directory
  • Update local working copy  git fetch 

  • Run

mvn eclipse:clean eclipse:eclipse deegree:eclipse -Dwtpversion=2.0 -DdownloadSources=true -DdownloadJavadocs=true -Declipse.workspace=/home/user/d3-workspace/ 
  • Open eclipse
  • Import the project again.

7. The deegree maven plugin

The deegree3/Maven page has a more detailed explanation regarding the deegree maven plugin's capabilities and usage.


CategoryDeegree3