-
Notifications
You must be signed in to change notification settings - Fork 92
Setting up Eclipse
This document details how to setup Eclipse Oxygen as your primary IDE for ZCS development.
Choose a location on your filesystem to checkout the source:
mkdir -p ~/Projects/Zimbra
cd ~/Projects/Zimbra
Clone the zm-zcs repository:
git clone [email protected]:Zimbra/zm-zcs.git
cd zm-zcs
git checkout develop
Create eclipse-ivysettings.xml
inside the zm-zcs
directory to hold the Ivy settings. This file is used by both Eclipse and Intelli-J in the Ivy Plugin to configure where it stores any dependencies downloaded or created during the build process.
Note: You may have to update the path to match your directory structure. Replace ${user.home}
with your home directory if necessary. If you are not running on Mac OS X update the path prefix accordingly. The path MUST be absolute.
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
<property name="httpclient.version" value="4.5.8"/>
<property name="httpclient.httpcore.version" value="4.4.11"/>
<property name="httpclient.async.version" value="4.1.4"/>
<property name="jetty.version" value="9.4.18.v20190429"/>
<property name="dom4j.version" value="2.1.1"/>
<property name="com.google.guava.version" value="28.1-jre"/>
<settings defaultResolver="chain-resolver" />
<caches defaultCacheDir="${user.home}/.ivy2/cache"/>
<resolvers>
<chain name="chain-resolver" returnFirst="true">
<filesystem name="local">
<artifact pattern= "${user.home}/.zcs-deps/[organisation]/[module]/[module]-[revision].[ext]" />
<artifact pattern= "${user.home}/.zcs-deps/[organisation]-[revision].[ext]" />
<artifact pattern= "${user.home}/.zcs-deps/[organisation].[ext]" />
</filesystem>
<ibiblio name="maven" m2compatible="true" usepoms="false"/>
<url name="zimbra">
<artifact pattern="https://files.zimbra.com/repository/[module]/[artifact]-[revision].[ext]" />
<artifact pattern="https://files.zimbra.com/repository/[module]/[artifact].[ext]" />
<artifact pattern="https://files.zimbra.com/repository/[organisation]/[module]/[module]-[revision].[ext]" />
</url>
</chain>
<!-- 'build-tmp' resolver is not part of the chain and is used only for packaging war files -->
<!--
<filesystem name="build-tmp">
<artifact pattern="${build.tmp.dir}/[module]-[revision].[ext]" />
</filesystem>
<filesystem name="build-dist">
<artifact pattern="${dist.dir}/[module]-[revision].[ext]" />
</filesystem>
-->
</resolvers>
</ivysettings>
Clone the zm-mailbox repository and checkout the branch that you would wish to work for:
git clone [email protected]:Zimbra/zm-mailbox.git # If you have a GitHub Account
git clone https://github.com/Zimbra/zm-mailbox.git # Anonymous clone
git checkout develop
Compile the zm-mailbox repo using following link:
https://github.com/Zimbra/zm-mailbox/wiki/How-to-set-up-development-environment-for-zm-mailbox-repository
Note: If you wish to contribute back to the project you will need to fork the repository and submit pull requests from your fork.
Once cloned locally you can proceed to setup the Eclipse by following the process below:
-
Open Eclipse Marketplace
-
Search for Apache IvyDE
-
Install Apache IvyDE
Push the install button and confirm.
Update the radio button to
I accept..
and push the Finish button to install IvyDE.Push the install anyway button when prompted by the security warning.
Push the Restart Now button when prompted to finish the installation:
-
Update Ivy Settings
Open the
Eclipse Preferences
menu:Select the
Ivy / Settings
submenu:Push the File System... button and navigate to
~/ProjectsZimbra/zm-zcs/
and select theeclipse-ivysettings.xml
file:Push the Open button to select the
eclipse-ivysettings.xml
.Note: If you don't have one of these files please re-read from the beginning and following the instructions titled:
Repository setup
Push the Apply and Close button.
-
Open Eclipse Oxygen.
-
Create a new empty workspace: Recommend using '~/Projects/Zimbra'.
-
Eclipse welcome screen
Close the welcome screen.
-
Eclipse main window will then appear:
-
Add
zm-zcs
as a new Java project:Unselect
Use default location
push Browse and navigate to~/Projects/Zimbra
and selectzm-zcs
:Push Open to complete the selection.
Push Finish to add the
zm-zcs
project to the workspace.
-
Add
zm-mailbox/native
as a new Java project:Push Browse and navigate to
~/Projects/Zimbra/zm-mailbox
and selectnative
:Push Open to complete the selection.
Push Finish to add the
zm-zcs
project to the workspace. -
Inform the Ivy subsystem of the new
native
project:Expand the
native
folder and right click on theivy.xml
file.Push Finish to update the Ivy dependencies.
-
Add
zm-mailbox/common
as a new Java project:Push Browse and navigate to
~/Projects/Zimbra/zm-mailbox
and selectcommon
:Push Open to complete the selection.
Push Next to update
common
project settings:Push the Projects tab to switch to the
common
project settings:The
zm-mailbox/common
project depends on thezm-mailbox/native
project. Click on the Add... button and select thenative
project and push OK.Push Finish to add the
zm-mailbox/common
project to the workspace. -
Inform the Ivy subsystem of the new
common
project:Expand the
common
folder and right click on theivy.xml
file.Push the Add Ivy Library... menu option:
Push Finish to update the Ivy dependencies.
-
Add
zm-mailbox/soap
as a new Java project:Push Browse and navigate to
~/Projects/Zimbra/zm-mailbox
and selectsoap
:Push Open to complete the selection.
Push Next to update
soap
project settings:Select the
soapdocs/src/java
andsoapdocs/src/java-test
.Right click and select
Remove from Build Path
Push the Projects tab to switch to the
soap
project settings:The
zm-mailbox/soap
project depends on thezm-mailbox/native
andzm-mailbox/common
projects. Click on the Add... button and select thenative
, andcommon
projects and push OK.Push Finish to add the
zm-mailbox/soap
project to the workspace. -
Inform the Ivy subsystem of the new
soap
project:Expand the
soap
folder and right click on theivy.xml
file.Push the Add Ivy Library... menu option:
Push Finish to update the Ivy dependencies.
-
Add
zm-mailbox/client
as a new Java project:Push Browse and navigate to
~/Projects/Zimbra/zm-mailbox
and selectclient
:Push Open to complete the selection.
Push the Projects tab to switch to the
client
project settings:The
zm-mailbox/client
project depends on thezm-mailbox/native
,zm-mailbox/common
, andzm-mailbox/soap
projects. Click on the Add... button and select thenative
,common
, andsoap
projects and push OK.Push Finish to add the
zm-mailbox/client
project to the workspace. -
Inform the Ivy subsystem of the new
soap
project:Expand the
soap
folder and right click on theivy.xml
file.Push the Add Ivy Library... menu option:
Push Finish to update the Ivy dependencies.
-
Add
zm-mailbox/store
as a new Java project:Push Browse and navigate to
~/Projects/Zimbra/zm-mailbox
and selectstore
:Push Open to complete the selection.
Push Next to update
store
project settings:Push the Projects tab to switch to the
store
project settings:The
zm-mailbox/store
project depends on thezm-mailbox/native
,zm-mailbox/common
,zm-mailbox/soap
, andzm-mailbox/client
projects.Click on the Add... button.
Select the
native
,common
,soap
, andclient
projects and push OK.Push Finish to add the
zm-mailbox/store
project to the workspace. -
Inform the Ivy subsystem of the new
store
project:Expand the
store
folder and right click on theivy.xml
file.Push the Add Ivy Library... menu option:
Push Finish to update the Ivy dependencies.
Eclipse supports debugging remotely over port 9999 to the Zimbra docker-zcs-dev-machine
development container.
Note: These instructions assume that the docker-zcs-dev-machine
container is running locally and is therefore accessible over localhost:9999. If this does not match your development environment please fill in the hostname and port that fits your environment.
-
Adding a debug runtime configuration
Click on the
Run
menu option and selectDebug Configurations
.The
Debug Configurations
dialog will appear:You will want to double-click on the
Remote Java Applications
item in the left column. This will create a new configuration which you may name.
Select Project, right-click properties
Go to Java Compiler and check compliance level is set to 1.8