Version 90.1 by Thomas Mortagne on 2011/04/21 16:09

Show last authors
1 The goal of this tutorial is to describe a way to setup Eclipse to be able to :
2
3 * edit web files (javascript, images, ...) in and automatically publish them in a running instance of XWiki without restarting it
4 * edit and debug java without restarting XWiki instance
5
6 All these tricks helps to improve the programming speed a lot.
7
8 {{toc/}}
9
10 = Prerequisites =
11
12 * Knowledges:
13 ** This tutorial does not explain how Eclipse/JDT works and how to install Eclipse plugins
14 ** 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]].
15 ** You should take a look at general [[XWiki sources repository structure>>Community.SourceRepository]].
16 * Tools
17 ** Java JDK 1.5 or superior
18 ** Apache Tomcat installed on your computer : http://tomcat.apache.org/
19 ** Eclipse: 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" one which includes other features and plugins such as the [[Web Tools Project>>http://www.eclipse.org/webtools]].
20 *** Maven Eclipse plugin: http://m2eclipse.sonatype.org/
21 *** AJDT Eclipse plugin: http://www.eclipse.org/ajdt/. If you plan to debug XWiki Core or any other project which contains AspectJ files.
22
23 = Get the source for XWiki =
24
25 Clone platform repository (see http://dev.xwiki.org/xwiki/bin/view/Community/SourceRepository#HCheckingoutsources) somewhere in your computer different from your Eclipse workspace.
26
27 {{code language="none"}}
28 git clone [email protected]:xwiki/xwiki-platform.git
29 {{/code}}
30
31 = Setting Eclipse =
32
33 To be able to launch XWiki into Eclipse and debug it we will create a WTP project which will be a mirror of the product web we want to work on. Here it will be [[XWiki Enterprise>>http://enterprise.xwiki.org]].
34
35 1. Checkout the default project (Recommended)
36 The best way to get the debug project is to clone it from [[[email protected]:xwiki/xwiki-debug-eclipse.git]] and look at the README file instructions.
37 {{warning}}Make sure to import it as Eclipse project and not as Maven project or it could break several pre-configured properties and it contains Eclipse linked resources based folders/files.{{/warning}}
38 1. [[Import and link maven jar projects to debug>>DebugXEWithEclipse_ImportJarProjects]]
39 1. [[Start XE Web Debug Project>>DebugXEWithEclipse_WebStart]]
40 1. [[Troubleshoots>>DebugXEWithEclipse_Troubleshoots]]
41 1. Enjoy :)
42
43 = Other useful tricks/tools =
44
45 * To dynamically validate your java code on XWiki codestyle you should use and configure [[Eclipse Checkstyle plugin>>Community.DevelopmentTools#HEclipsecs]] (Note that this is already installed and configured in Yoxos Eclipse distribution for XWiki).
46 * Look at [[Community.DevelopmentTools]] for a list of usefull development tools.
47 * You can use XEclipse to edit wiki pages : [[code:Extensions.XEclipseExtension]].
48
49 = TODO =
50
51 * find a way to support new wysiwyg
52 * add more explanation on how "Run as server" works behind the scene
53 * http://code.google.com/p/m2eclipse-wtp-ext/ seems promising

Get Connected