Setting up a bzr-eclipse Development Environment
Use these instructions to set up development environment for working on bzr-eclipse itself. Development will be done in Eclipse.
Java Development Kit 1.6 or higher
A Java Runtime Environment (JRE) is not enough. Ensure that your JAVA_HOME environment variable is set correctly, it is required by Maven.
"Eclipse for RCP and RAP Developers" 3.7 or higher from http://www.eclipse.org/downloads/
It's important to choose the RCP/RAP version because it includes all the libraries required for Eclipse plug-in development. The newest version of Eclipse is your best choice, but older versions are probably ok.
Bazaar 2.0 or higher
Maven 2 will not work
You'll need the bzr-eclipse plugin 1.2 or higher. Currently there is no official download site, but we'll sort that out soon. Earlier versions of bzr-eclipse don't work because they don't create the required Eclipse projects.
From within Eclipse, install like this:
Use the Eclipse menu: Help -> Install New Software to open the "Available Software" dialog.
- Press "Add" in the top right corner to open another dialog, and provide the name "bzr-eclipse", and location of the official download site.
- Click "OK" to return to the "Available Software" dialog.
- In the selection section, open up "Collaboration" and select "Eclipse plugin for Bazaar VCS"
- Click "Next", then Eclipse shows dependencies.
- Click "Next" again to see the License Agreement.
- Accept the License Agreement and click "Finish".
- You may receive a warning about unsigned content, which can be accepted via "OK".
Create a new workspace in a new folder
You want a dedicated folder and workspace for bzr-eclipse development because it includes several projects and sub-folders. If you already have an empty workspace, you can use that.
Use the Eclipse menu: "File -> Switch Workspace -> Other" which opens a dialog allowing you to enter a workspace folder.
- Enter a new folder name into the dialog and choose "OK" which will cause Eclipse to restart in your new workspace.
Configure your Bazaar user information for commit messages.
Use the Eclipse menu: "Window -> Preferences", then locate the preference panel: "Team -> Bazaar", and update the field "User id/email:".
Recommended format is "name launchpad-id <email address>", e.g. Alexander Taler ~alex-idereal <alex@--idereal.--.nz>.
Set the compiler compliance level to 1.5, which is the required value for bzr-eclipse.
Use Eclipse menu: "Window -> Preferences", then locate "Java -> Compiler".
Fetch code from Launchpad
You need code for these three projects:
bzr-xmloutput Use the bzr-eclipse tailored branch lp:~bzr-eclipse/bzr-xmloutput/trunk or explore branches on launchpad
bzr-java-lib Use trunk lp:bzr-java-lib or explore branches on launchpad
bzr-eclipse Use trunk lp:bzr-eclipse or explore branches on launchpad
The following steps will fetch the code for you and create the required Eclipse projects, using the bzr-eclipse plugin you installed earlier.
In the Eclipse menu, choose "File -> New -> Project" which will open a Wizard.
Select "Bazaar -> Project from Bazaar" and click "Next". You are shown the Eclipse Project from Bazaar wizard.
- You may receive a strange warning message about dependencies, ignore it and click "OK".
- Enter a URL for the project, e.g. the trunk shown above. bzr-eclipse will suggest a project name and sub-folder, which should be fine. Click "Next" to see the Advanced Options.
- Change type to "Branch", so that you don't automatically affect the launchpad branch.
- Click "Finish". The Wizard now performs the checkout, but does not provide feedback. Wait patiently because it can take several minutes.
- When the dialog is closed, if the Eclipse intro page is still open, close it to go the work-bench view, where you will see the new projects, one for each of bzr-xmloutput and bzr-java-lib, and several for bzr-eclipse.
Fixing the builds and dependencies
At this point Eclipse will report a lot of errors and warnings in the bzr-eclipse projects. To fix these:
In Eclipse, go to the bzr-java-lib project, right-click, select "Run As" -> "Maven install"
This may take some time to complete, it builds and copies the bzr-java-lib jar file to your Maven repository (probably under ~/.m2)
- In a terminal window, go to the bzr-eclipse folder and run "mvn package". This takes some time, and may need to download a bunch of dependencies.
- Back in Eclipse, go to each of the projects and press F5 to refresh them, which should remove the errors and warnings.
Running bzr-eclipse in debug mode
Eclipse can run a second Eclipse instance with your development version of bzr-eclipse included.
Select the org.vcs.bazaar.eclipse.ui project
Right click or use the menu to select Debug or Run as Eclipse Application
- Create new test workspaces within this second Eclipse.