Working with Eclipse

Version 129.1 by Thomas Mortagne on 2012/02/14 15:26

This document contains instructions on how to configure Eclipse for building and developing XWiki. It should be noted that these are generic instructions, some components / sub-projects of XWiki might require specific configurations on Eclipse that may not be covered in this document.

It is necessary that you Install & Configure Maven before trying anything here.

Prerequisites

  • Knowledges:
    • This tutorial does not explain how Eclipse/JDT works and how to install Eclipse plugins
    • You should already know how to build XWiki using maven and also how maven generally works, how to create pom.xml, etc. You can look at Building XWiki.
    • You should take a look at general XWiki sources repository structure.
  • Tools
    • Java JDK 6 or superior

Get the source for XWiki

Clone platform repository (see http://dev.xwiki.org/xwiki/bin/view/Community/SourceRepository#HCheckingoutsources) somewhere in your computer different from your Eclipse workspace.

git clone [email protected]:xwiki/xwiki-platform.git

or replace [email protected]:xwiki/xwiki-platform.git by your own fork of platform.

Installing Eclipse

Importing a project With M2Eclipse

  • Now we're going to import the XWiki source (checked out above) into your Eclipse workspace. Select [File->Import] and there under the General category, select Maven Projects and click Next.
  • On the next screen, point Root Directory to whatever XWiki module you wish to work on. If you point the Root Directory to top-level repository folder, you will end up with a gazillion of Eclipse projects. Therefor only select the module you wish to work on, and keep in mind that M2Eclipse will take care of dependencies.
  • Finally, click Finish to dismiss the import wizard and let the workspace adjust itself (This will take some time depending on the number of projects to be imported).
  • Now you can execute maven goals simply by right-clicking on the project and then [Run As-><Maven Goal>]. Observe the output from maven now appearing on the Console viewer of Eclipse.
  • That's it! Happy Hacking ...

Other useful tricks/tools

  • To dynamically validate your java code on XWiki codestyle you should use and configure Eclipse Checkstyle plugin (Note that this is already installed and configured in Yoxos Eclipse distribution for XWiki).
  • Look at DevelopmentTools for a list of usefull development tools.
  • You can use XEclipse to edit wiki pages : Main.

Debug XWiki

Tags: eclipse
   

Get Connected