From version < 131.1 >
edited by Thomas Mortagne
on 2013/03/13 18:15
To version < 132.2 >
edited by Clemens Robbenhaar
on 2016/05/10 17:17
< >
Change comment: need java 8 meanwhile

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.ThomasMortagne
1 +xwiki:XWiki.ClemensRobbenhaar
Content
... ... @@ -4,48 +4,50 @@
4 4  
5 5  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.
6 6  
7 -{{warning}}It is necessary that you [[Install & Configure Maven>>http://dev.xwiki.org/xwiki/bin/view/Community/Building#HInstallingMaven]] before trying anything here.{{/warning}}
7 +{{warning}}
8 +It is necessary that you [[Install & Configure Maven>>Building||anchor="HInstallingMaven"]] before trying anything here.
9 +{{/warning}}
8 8  
9 9  = Prerequisites =
10 10  
11 11  * Knowledges:
12 12  ** This tutorial does not explain how Eclipse/JDT works and how to install Eclipse plugins
13 -** 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>>Community.Building]].
14 -** You should take a look at general [[XWiki sources repository structure>>Community.SourceRepository]].
15 +** 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>>Building]].
16 +** You should take a look at general [[XWiki's sources repository structure>>SourceRepository]].
15 15  * Tools
16 -** Java JDK 6 or superior
18 +** Java JDK 8 or superior
17 17  
18 18  = Get the source for XWiki =
19 19  
20 -Clone platform repository (see http://dev.xwiki.org/xwiki/bin/view/Community/SourceRepository#HCheckingoutsources) somewhere in your computer different from your Eclipse workspace.
22 +[[Clone platform repository>>SourceRepository]] somewhere in your computer different from your Eclipse workspace:
21 21  
22 22  {{code language="none"}}
23 23  git clone [email protected]:xwiki/xwiki-platform.git
24 24  {{/code}}
25 25  
26 -or replace ##[email protected]:xwiki/xwiki-platform.git## by your own fork of platform.
28 +or replace ##[email protected]:xwiki/xwiki-platform.git## with your own fork of platform.
27 27  
28 28  = Installing Eclipse =
29 29  
30 -* You can download Eclipse from the [[Eclipse Download Site>>http://www.eclipse.org/downloads/]]. Alternatively you can download one of the many Eclipse distributions, such as the "Eclipse IDE for Java EE Developers" which includes other features and plugins such as the [[Web Tools Project>>http://www.eclipse.org/webtools]].
31 -* Install Maven Eclipse plugin: http://m2eclipse.sonatype.org/
32 -* Optionally you might want to install the Web Tools Project (WTP) feature if you want to deploy XWiki to a support server without having to leave the Eclipse IDE, See [[The WTP homepage>>http://www.eclipse.org/webtools/]] for details and [[Installing and Using the Eclipse Web Tools>>http://www.eclipse.org/downloads/download.php?r=1&file=/technology/phoenix/demos/install-wtp/install-wtp.html||target=_new]] for help.
33 -* You might also want to work on AspectJ based legacy code legacy, for that you should install AJDT Eclipse plugin: http://www.eclipse.org/ajdt/.
32 +* You can download Eclipse from the [[Eclipse Download Site>>http://www.eclipse.org/downloads/]]. Alternatively you can download one of the many Eclipse distributions, such as the "Eclipse IDE for Java EE Developers" which includes other features and plugins such as the [[Web Tools Project>>http://www.eclipse.org/webtools/]].
33 +* Install the [[Maven Eclipse plugin>>http://www.sonatype.org/m2eclipse/]] (if you installed "Eclipse IDE for Java EE - Kepler" distribution, the Maven Eclipse plugin is already bundled with it)
34 +* Optionally you might want to install the Web Tools Project (WTP) feature if you want to deploy XWiki to a support server without having to leave the Eclipse IDE, See [[The WTP homepage>>http://www.eclipse.org/webtools/]] for details and [[Installing and Using the Eclipse Web Tools>>http://wiki.eclipse.org/WTP_FAQ#How_do_I_install_WTP.3F]] for help. (this is not needed if you installed the "Eclipse IDE for Java EE" distribution)
35 +* You might also want to work on AspectJ based legacy code legacy, for that you should install the [[AJDT Eclipse plugin>>http://www.eclipse.org/ajdt/]].
34 34  
35 35  = Importing a project With M2Eclipse =
36 36  
37 -* 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**.
38 -* 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.
39 -* 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).
39 +* Now we're going to import the XWiki source (checked out above) into your Eclipse workspace. Select **[File->Import]** and under the **General** category, select **Maven Projects** and click **Next**.
40 +* 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 Eclipse projects. Therefor only select the module you wish to work on, and keep in mind that M2Eclipse will take care of dependencies.
41 +* 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).
40 40  * 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.
41 -* That's it! Happy Hacking ...
43 +* That's it! Happy Hacking...
42 42  
43 43  = Other useful tricks/tools =
44 44  
45 -* To dynamically validate your java code on XWiki codestyle you should use and configure [[Eclipse Checkstyle plugin>>Community.DevelopmentTools||anchor="HEclipsecs"]].
46 -* Look at [[Community.DevelopmentTools]] for a list of usefull development tools.
47 -* You can use XEclipse to edit wiki pages : [[xeclipse:Main.WebHome]].
47 +* To dynamically validate your java code on XWiki codestyle you should use and configure the [[Eclipse Checkstyle plugin>>DevelopmentTools||anchor="HEclipse-cs"]].
48 +* Look at [[Development Tools>>DevelopmentTools]] for a list of useful development tools.
49 +* You can use [[XEclipse>>xeclipse:Main.WebHome]] to edit wiki pages.
48 48  
49 49  = Debug XWiki =
50 50  
51 -* [[Debug XWiki using WTP>>Community.DebugXEWithEclipse]]
53 +* [[Debug XWiki using WTP>>DebugXEWithEclipse]]

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.

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

Prerequisites

  • Knowledges:
  • Tools
    • Java JDK 6 or superior
    • Java JDK 8 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.

Clone platform repository 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.

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

Installing Eclipse

  • You can download Eclipse from the Eclipse Download Site. Alternatively you can download one of the many Eclipse distributions, such as the "Eclipse IDE for Java EE Developers" which includes other features and plugins such as the Web Tools Project.
  • Install Maven Eclipse plugin: http://m2eclipse.sonatype.org/
  • Install the Maven Eclipse plugin (if you installed "Eclipse IDE for Java EE - Kepler" distribution, the Maven Eclipse plugin is already bundled with it)
  • Optionally you might want to install the Web Tools Project (WTP) feature if you want to deploy XWiki to a support server without having to leave the Eclipse IDE, See The WTP homepage for details and Installing and Using the Eclipse Web Tools for help.
  • Optionally you might want to install the Web Tools Project (WTP) feature if you want to deploy XWiki to a support server without having to leave the Eclipse IDE, See The WTP homepage for details and Installing and Using the Eclipse Web Tools for help. (this is not needed if you installed the "Eclipse IDE for Java EE" distribution)
  • You might also want to work on AspectJ based legacy code legacy, for that you should install AJDT Eclipse plugin: http://www.eclipse.org/ajdt/.
  • You might also want to work on AspectJ based legacy code legacy, for that you should install the AJDT Eclipse plugin.

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.
  • Now we're going to import the XWiki source (checked out above) into your Eclipse workspace. Select [File->Import] and 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.
  • 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 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).
  • 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->]. Observe the output from maven now appearing on the Console viewer of Eclipse.
  • That's it! Happy Hacking ...
  • That's it! Happy Hacking...

Other useful tricks/tools

Debug XWiki

Get Connected