This document describes how to get and build the sources. It also covers how to setup the Eclipse workspace to run Red Hat Fuse Tooling from inside a vanilla Eclipse.
The easiest way to get started with the code is to create your own fork at github, and then clone your fork:
git clone git@github.com:<you>/jbosstools-fuse.git
cd jbosstools-fuse
git remote add upstream https://github.com/jbosstools/jbosstools-fuse.git
At any time, you can pull changes from the upstream and merge them onto your main:
git checkout main # switches to the 'main' branch
git pull --rebase upstream main # fetches all 'upstream' changes and merges 'upstream/main' onto your 'main' branch
git push origin # pushes all the updates to your fork, which should be in-sync with 'upstream'
The general idea is to keep your 'main' branch in-sync with the 'upstream/main'.
To build Red Hat Fuse Tooling requires specific versions of Java (1.6+) and +Maven (3.0+).
This command will run the build:
mvn clean verify
If you just want to check if things compiles/builds you can run:
mvn clean verify -DskipTests
If you want to do development in Eclipse for Fuse Tooling you need to use the JBDS Integration Stack Target Platform.
Here's how to retrieve the target files describing the Target Platform...
cd jbosstools-fuse/targetplatform
mvn clean verify -Pmultiple2repo -Dmirror-target-to-repo.includeSources=true
Once the build is done you end up with a file fuse-multiple.target inside the target subfolder. Now open this file with Target File editor from Eclipse IDE and click "Set as target Platform" at the top right. Be patient... and it will be ready.
At main branch we always try to use the latest Eclipse version. Please refer to the target platform plugin to see which versions of Eclipse are supported. The main branch was using Eclipse Luna when this document was created.
Now its time to open your Eclipse if you haven't done so.
Here's how to setup Eclipse...
- create a new workspace for working on Red Hat Fuse Tooling
- import the project into Eclipse from directory "fuseide" (Import... -> General -> Existing Project)
Now your Eclipse has set the target platform you need for running Red Hat Fuse Tooling. A rebuild of all imported projects is done directly after setting the target platform. Make sure there are no more errors displayed in any of the projects.
To get rid of the access restriction warnings open menu
Eclipse -> Preferences -> Java -> Compiler / Errors/Warnings -> Deprecated and restricted API
then turn Forbidden reference (access rules) to "Warning" (it was "Error").
Before trying to run the Fuse Tooling you should have built the project, imported it successfully into Eclipse and also set the correct target platform (see the steps above).
To run open the Run Configurations dialog and select one of the following Eclipse Applications:
JBTIS Neon Linux x86_64.launch # Eclipse Neon based
JBTIS Neon Mac OS.launch # Eclipse Neon based
JBTIS Neon Windows.launch # Eclipse Neon based
It may be possible that you have to adapt the launch configuration to fit your environment. If your OS doesn't have a launch configuration yet just create one by copying one of the Linux configurations and then inside the Plugins tab make sure to hit the Add required button. That should fix most of the problems.
Tycho downloads all needed plugins into the folder
<user.home>/.m2/repository/p2
If you kill a Tycho build you can sometimes end up with corrupted downloads leading to failed builds. The usual exception you will see then is something like this...
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at org.codehaus.tycho.osgitools.DefaultBundleReader.doLoadManifest(DefaultBundleReader.java:85)
at org.codehaus.tycho.osgitools.DefaultBundleReader.loadManifest(DefaultBundleReader.java:47)
at org.codehaus.tycho.osgitools.EquinoxResolver.loadManifest(EquinoxResolver.java:199)
at org.codehaus.tycho.osgitools.EquinoxResolver.addBundle(EquinoxResolver.java:175)
at org.codehaus.tycho.osgitools.EquinoxResolver.newState(EquinoxResolver.java:157)
at org.codehaus.tycho.osgitools.EquinoxResolver.newResolvedState(EquinoxResolver.java:52)
The quick fix is to trash your folder:
~/.m2/repository/p2
Be careful deleting that folder as with the next build it will download lots of plugins from the internet again.