Locked History Actions

Eclipse

Developing deegree with Eclipse

Eclipse (http://www.eclipse.org/) is a general purpose integrated development environment (IDE). Eclipse runs on multiple platforms such as Windows and Linux. Eclipse is used for many programming languages and targets many platforms. Eclipse is especially popular amongst Java developers and as such is a perfect environment for working with deegree.

We recommend picking the current Eclipse Galileo version as the full-featured "Eclipse IDE for Java EE developers" download. It includes some plugins that are very useful to deegree development, such as JSP and XML editors.

1. Registered deegree developers

If you want to become an active committer to the deegree project, either as developer or as contributor for documentation (besides this wiki), please make yourself familiar with the project's structures and procedures. If the project steering committee (PSC) accepts you into the group of official committers, you will probably also want to read how to get commit access to the deegree SVN.

2. Loading deegree into Eclipse

You can import the deegree sources into Eclipse straight from deegree's SVN repository.

2.1. Installing an Eclipse SVN Client

The most comfortable way of accessing the deegree SVN from Eclipse is by using an Eclipse SVN plugin such as Subclipse or Subversive. We recommend using Subclipse 1.6. You can find the required installation steps on the download and install pages on the Subclipse website.

Please note that using a 1.6 Subclipse version will use the SVN 1.6 format for the local checkouts. If you want to use the command line SVN tool for working with these checkouts as well, you will need a version from the 1.6 series as well.

There seems to be a bug in some OS / Eclipse environments, that you are not able to 'Add' the URL of Subclipse at the 'Available Software Site'.
add_subversion_site.png

Setting the variable 'export GDK_NATIVE_WINDOWS=true' seemed to solve this.

2.2. Checking out deegree from the SVN repository using Subclipse

3. How To Configure Eclipse

After you have loaded the deegree source files into an Eclipse project, you should apply the following settings in Eclipse:

Window -> Preferences -> Java -> Code Style -> Code Templates

Window -> Preferences -> Java -> Code Style -> Formatter

Window -> Preferences -> Java -> Editor -> Templates

3.1. Using Predefined Commit Templates for SVN Check-in

If you are a developer with the right to commit to the svn directly, you are required to use the Eclipse/CommitTemplates. Here's the best way to integrate them into your Eclipse setup:

  1. goto "Window" - "Preferences"
  2. select "Team" - "SVN" - "Comment Templates"
  3. press "new", add the first commit template and hit "OK"
  4. repeat this for each available template

Once you added all templates to Eclipse, you are ready to use them, when committing to deegree SVN. Please always make sure to choose the appropriate topic and select the correct predefined type(s) and module. Also be sure to write a useful description message.

The commit messages are going to be analysed with each new release and provide the basis for the release notes.

3.2. Editing SVN Property Settings

There are some SVN settings that need to be changed as well: SVN Properties.

As you may have noticed, there are some SVN keywords being used within the javadoc blocks of each Java class. If you have commit rights to the deegree SVN, then you should activate these SVN properties, because otherwise they don't get transformed into their respective values automatically, but stay in the files as simple (and useless) text tokens.

You can either change the settings manually for each file (context menu: Team - Set Property), which is very cumbersome and thus discouraged.

Or, do this: With the editor of your choice open the file

  • LINUX: /home/<username>/.subversion/config
    WINDOWS: %APPDATA%\Subversion\config

    • Depending on your Windows version %APPDATA% resolves to something like C:\Users\<username>\AppData\Roaming\ or C:\Dokumente und Einstellungen\<username>\Application Data

First of all make sure to have "enable-auto-props" set to yes and active (no comment signs)

  • ### Set enable-auto-props to 'yes' to enable automatic properties
    ### for 'svn add' and 'svn import', it defaults to 'no'.
    ### Automatic properties are defined in the section 'auto-props'.
    enable-auto-props = yes

Secondly, specify all the svn properties for the file types that you whish to be set automaticaly:

  • ### Section for configuring automatic properties.
    [auto-props]
    ### The format of the entries is:
    ###   file-name-pattern = propname[=value][;propname[=value]...]
    ### The file-name-pattern can contain wildcards (such as '*' and
    ### '?').  All entries which match will be applied to the file.
    ### Note that auto-props functionality must be enabled, which
    ### is typically done by setting the 'enable-auto-props' option.
    # *.c = svn:eol-style=native
    # *.cpp = svn:eol-style=native
    # *.h = svn:eol-style=native
    # *.dsp = svn:eol-style=CRLF
    # *.dsw = svn:eol-style=CRLF
    # *.sh = svn:eol-style=native;svn:executable
    # *.txt = svn:eol-style=native
    # *.png = svn:mime-type=image/png
    # *.jpg = svn:mime-type=image/jpeg
    # Makefile = svn:eol-style=native

As deegree committer please make sure to add the following lines:

  • *.java = svn:keywords=Author Date HeadURL Revision Id
    *.jsp = svn:keywords=Author Date HeadURL Revision Id
    *.js = svn:keywords=Author Date HeadURL Revision Id
    *.xml = svn:keywords=Author Date HeadURL Revision Id
    *.html = svn:keywords=Author Date HeadURL Revision Id

3.3. Importing deegree2 libs into build-path

This chapter is on deegree2 only!

  1. goto project properties -> java build path

  2. select tab libraries, add external jars
  3. select lib directory in the deegree source tree
  4. expand each subdirectory to see all jars (works only on linux)
  5. select the first entry
  6. press and hold shift
  7. select the last jar entry (by now all should be highlighted)
  8. release shift
  9. deselect all directories (by holding the strg/ctrl key), because the ok button will not be available until only jars are selected.
  10. finally press ok to add all jars to the build path

Under Linux this saves a lot of clicks. Under Windows you have click and add each of the jar files under the lib directory.

3.4. XML-Validation Settings

There seems to be a bug in some Eclipse environments, when it comes to XML-Validation. To solve this problem, please make sure you haven't selected the checkmark "Honour all XML schema locations". You should apply the following settings in Eclipse:

Window -> Preferences -> XML -> XML-Files -> Validation

  • please remove the checkmark "Honour all XML schema locations"

xml_validation.png

4. Further Reading

See also: http://java.sun.com/j2se/javadoc/writingdoccomments/