This page last changed on Sep 14, 2006 by bob.swift@charter.net.
How to use Eclipse for Confluence plugin development
Eclipse can be used to make Confluence plugin development easier.
General setup
- Install Eclipse
- Use Subversion
- Use Maven
- Install Maven 1.0.x
- Install the Maven (1.x) Eclipse plugin by downloading the jar and copying to the Eclipse plugin directory
- Setup your MAVEN_REPO property in Eclipse to point to your Eclipse workspace location
Plugin specific
The following assumes you have a somewhat standard plugin directory structure that you created or checked out from Subversion. For example:
- Edit the project.xml file to make sure it contains all the dependencies needed
- This must be done before generating the Eclipse project files
- If the dependencies need to be changed later, the Eclipse project files will need to be re-generated and then in Eclipse, refresh your project using right click -> Refresh
- Generate the Eclipse project and classpath files
- From a command line, cd to the trunk directory
- Move the .project and .classfile files to the xxx-plugin directory
- Import the project by pointing at the plugin directory (that now contains a .project file!)
- Right click Import
- Choose Existing Projects into Workspace

- Customize the build path source using right click on project -> Build Path -> Configure Build Path
- removing the default location
- adding /trunk/src/etc
- adding /trunk/src/java
- adding /trunk (last)
- Add MAVEN_REPO classpath variable to Eclipse
- This only needs to be done for the first plugin you setup
- MAVEN_REPO is used in the Maven generated .classpath file that contains references to all the dependencies defined to Maven in the project.xml and related files
- Customize the build path libraries using right click on project -> Build Path -> Configure Build Path

- Add a new variable that points to your maven repository directory

Summary
- Eclipse should now analyse the plugin code and report errors
- Once all errors are fixed in Eclipse, a maven build (run outside Eclipse) should be clean
|