Setting up Eclipse for debugging XWiki Enterprise
The goal of this tutorial is to describe a way to setup Eclipse to be able to :- edit web files (javascript, images, ...) in and automatically publish them in a running instance of XWiki without restarting it
- edit and debug java without restarting XWiki instance
Prerequisites
- Knowledges:
- This tutorial does not explain own Eclipse/JDT works and ow to install Eclipse plugins
- You should already know how to build XWiki using maven and also own maven generally works, how to create pom.xml, etc. You can look at Building XWiki.
- Tools
- Java JDK 1.5 or superior (this tutorial is based on 1.6)
- Apache Tomcat installed or your computer (this tutorial is based on 5.5) : http://tomcat.apache.org/
- Eclipse (this tutorial is based on Eclipse J2EE Europa/3.3): You can download Eclipse from the Eclipse Download Site. XWiki doesn't need the very latest version; but if you are going to download Eclipse you might as well get the latest 3.3 level. 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.
- Maven Eclipse plugin (this tutorial is based on 0.9): http://m2eclipse.codehaus.org/
- Subversion Eclipse plugin (this tutorial is based on 0.7): http://www.eclipse.org/subversive/
- AJDT Eclipse plugin (this tutorial is based on 1.5.1): http://www.eclipse.org/ajdt/. If you plan to debug XWiki Core or any other project which contains AspectJ files.
Get the source for XWiki
Checkout trunks (see http://dev.xwiki.org/xwiki/bin/view/Community/SourceRepository#HCheckingoutsources) somewhere in your computer different from your Eclipse workspace.svn co https://svn.xwiki.org/svnroot/xwiki/trunks
Setting Eclipse
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.- Create XE Web Debug Project
- Mirror XE web in XE Web Debug Project
- Set XE Web Debug Project dependencies using M2Eclipse
- Import and link maven jar projects to debug
- Start XE Web Debug Project
- Troubleshoots
- Enjoy :)
Other useful tricks/tools
- You should use XEclipse to edit wiki pages : XEclipse Extension.
- To dynamically validate your java code on XWiki codestyle you should use and configure Eclipse Checkstyle plugin.
TODO
- add more explanation on how "Run as server" works behind the scene
Version 48.1 last modified by ThomasMortagne on 09/07/2008 at 12:03
Document data
Attachments:
No attachments for this document
Comments: 0