--- Eclipse configuration --- Andrés Gómez Casanova --- 2010-03-07 ---

Zemucan in Eclipse

This section shows how to configure Eclipse in order to work on Zemucan.

It assumes that you have all the necessary plugins. There is a special configuration ready to download from Yoxos in this link:

http://ondemand.yoxos.com/geteclipse/rap?profiles=868129468_1245185589469641666

This procedure does not use the Maven plugins for Eclipse.

Plugins

This is the list of plugins used for the project:

  • Java Development Tools (JDT).
  • Subversive SVN.
  • AnyEditTools.
  • Eclipse XML Editors and Tools.
  • IAM.
  • JDT Decorators.
  • UML2.
  • EclEmma Java Code Coverage.
  • Eclipse Checkstyle.
  • PMD.
  • Find Bugs.
  • UCDetector.

SVN configuration

  • You open Eclipse, and you change to the SVN perspective: 'Window', 'Open Perspective', 'Other...', and select 'SVN Repository Exploring'.
  • New Repository Location
  • In the new window, 'General' tab, write this address https://zemucan.svn.sourceforge.net/svnroot/zemucan in the URL field.
  • Then, click in finish, and there will be a window for a few seconds that establishes the SVN configuration.

For more information about this, please visit the svn section.

Download Libraries

First, we will download the necessary libraries in order to compile the project in Eclipse.

  • You do right click in vendor, and then checkout.

Download sources

  • Now, that you have access to the project, you select the last stable development branch called trunk, and you right click on there, and select the checkout option.

    It will take all the sources, and create a new project in your Eclipse environment.

    Probably you could want to download a development version, and that will be a branch in the branches directory.

Configure the project

  • Now, you change back to your development perspective, in this case Java: Menu 'Window', 'Open Perspective', 'Java'.
  • You will see a project in the 'Package explorer' view. You will delete it from the list, and the re-import it. Right click in the project, that must be called zemucan. When asking if you are sure to delete the project, make sure the option 'Delete project contents on disk' is NOT selected.
  • Now, you will create another project as a Java project, but you will take the sources that you have download. Menu 'File', 'New', 'Java Project'.
  • In this window you will write the same project name as before. In this case 'zemucan'. Eclipse detects that the project name types corresponds to a directory with the same name by saying 'The wizard will automatically configure the JRE and the project layout based on the existing source.'
  • You click in 'Next', in order to configure the libraries.
  • Then, there will be several tabs, you select the 'Libraries' one.
  • You will add the necessary libraries to compile and execute the application. Click in the 'Add JARs...' button, and search the all the libraries in the vendor project. You select them by hold Ctrl and clicking over it. Currently (2010-03-09) you have to select 5 libraries: 2 for Logback, 1 for Jline, 1 for JUnit and 1 for SLF4J.
  • Click in Finish. Now the application is being compiled, and you should not see any error.

    However, there are some files necessaries when executing the application, or running the tests. You have to add them to the 'Build Path'.

  • You browse the directories like this zemucan, source-code/main/src/main/resources.
  • Right click on it, and select 'Build Path', and then 'Use as Source Folder'.
  • You do almost the same for source-code/main/src/test/resources.
  • Right click on it, and select 'Build Path', and then 'Use as Source Folder'.

Now, you have Eclipse configured to develop the application.

Currently, there are two SVN plugins for Eclipse, so the instructions are not the same for both, here, we used Subversive. However, the functionality of both is the same.

As you have seen, this configuration does not uses a plugin as M2Eclipse to manage the Maven behavior in Eclipse. It uses a normal configuration, and the Maven part can be tested from the command line, by doing mvn package.

Notes

If there is a problem with the SVN file, such as: "Duplicated resource", you have to configure the ignore property in Eclipse for the building part.

You could just edit the .classpath file and change all lines for directories from:

<classpathentry kind="src" path="source-code/tools/src/test/java"/>

To:

<classpathentry excluding="**/.svn/" kind="src" path="source-code/tools/src/test/java"/>

As you could notice, the excluding tag was added, indicating to ignore all .svn directories in any directory.

Extras

Do not forget to configure:

  • PMD with the configuration file.
  • Checkstyle with the configuration file.
  • FindBugs.
  • Eclipse formatting with the configuration file.
  • Eclipse cleanup with the configuration file.
  • Anytools to not modify .properties files.
  • If using Linux, change the project encoding (Properties, Resource, Text File Encoding, Other, ISO-8859-1)

Video

Take a look at this video, showing how to download the sources and configure Eclipse: