Version 97.1 by Thomas Mortagne on 2011/05/16 10:53

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 or replace ##[email protected]:xwiki/xwiki-platform.git## by your own fork of platform.
32
33 = Setting Eclipse =
34
35 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's [[XWiki Enterprise Manager>>http://manager.xwiki.org]].
36
37 1. Checkout xwiki-debug-eclipse project
38 Clone it from ##[email protected]:xwiki/xwiki-debug-eclipse.git## and look at the README file instructions.
39 {{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}}
40 1. [[Import and link maven jar projects to debug>>DebugXEWithEclipse_ImportJarProjects]]
41 1. [[Start XE Web Debug Project>>DebugXEWithEclipse_WebStart]]
42 1. [[Troubleshoots>>DebugXEWithEclipse_Troubleshoots]]
43 1. Enjoy :)
44
45 = Other useful tricks/tools =
46
47 * To dynamically validate your java code on XWiki codestyle you should use and configure [[Eclipse Checkstyle plugin>>Community.DevelopmentTools||anchor="HEclipsecs"]] (Note that this is already installed and configured in Yoxos Eclipse distribution for XWiki).
48 * Look at [[Community.DevelopmentTools]] for a list of usefull development tools.
49 * You can use XEclipse to edit wiki pages : [[code:Extensions.XEclipseExtension]].
50
51 = TODO =
52
53 * find a way to support new wysiwyg
54 * add more explanation on how "Run as server" works behind the scene
55 * http://code.google.com/p/m2eclipse-wtp-ext/ seems promising

Get Connected