|Tutorial - Checking out Taverna source code, compiling, running and debugging|
This is part of the Tutorial - Checking out Taverna source code, compiling, running and debugging
After checking out Taverna we'll compile and build from source code using the Apache Maven tools.
We assume you have already configured Maven as explained in the previous steps of this tutorial, and that the checkout has completed.
You should now have a project
maintenance in your Package Explorer:
taverna-workbench, right click on maintenance and select Refactor -> Rename....
After renaming, to build Taverna, right click on taverna-workbench and select Run as -> Maven build... An _Edit Configuration_ window should appear.
For the Goals, set
Before you click OK, first go to the JRE tab to modify the Maven memory settings to be able to do the whole build and unit tests in one go. Under VM Arguments, add:
Click Apply and Run to start the build.
The Console tab should show Maven output:
|Console tab missing?|
If the Console tab is missing, click Window -> Reset perspective, or Window -> Show View -> Console.
Building Taverna for the first time will take a while to complete as it compiles every module and runs every unit test.
Once the build has completed, the Console output should say something like:
Starting the developer build
Now you should be able to run the Taverna Workbench developer build from the command line. A minimal Taverna distribution should be under
target/taverna-dev-* in the
The Taverna Nightly splashscreen should appear while Taverna is starting up. (On Windows, run
taverna-debug.bat instead of
You will notice that the title bar of Taverna will include the time of the build.
Note that you might have to configure Taverna on where to find the Graphviz dot binary in this developer version. On OS X you should be able to find a copy of
dot inside an existing Taverna application bundle, say
|Not starting on Windows XP?|
If you are running the developer build on Windows XP, or your home directory contains characters which are not valid in a URL, such as spaces, you would need to modify the generated
If you compare the
taverna-dev-2.3-SNAPSHOT-20101111T1424-dev directory with a normal Taverna installation, you will see that the
repository folder is missing. Taverna will try to download any missing dependencies, but in the official Taverna downloads, all required JARs are included in the
For users of the developer build it is likely that you would want to change only particulars module of Taverna while you are developing it, so to avoid having to do a new full build, the plugin definition (which is used even by the main components of Taverna) includes a reference to your local Maven repository.
taverna-dev-2.3-SNAPSHOT-20101111T1424-dev/plugins/plugins.xml to find:
This means that the
.m2/repository folder on your file system will be searched for any POMs and JARs, and as it is a local
file: reference, those dependencies will not be copied to
$HOME/.taverna-2.3/repository as when installing a plugin.
The advantage of this is that if you as a developer is modifying a particular module of Taverna like the Beanshell activity, you may do a Maven install on just that module (
mvn clean install on the command line, or right clicking and doing Run as -> Maven install on that particular folder in Eclipse), and the distribution in workbench-distro should pick up the new version on next restart, without requiring a rebuild of any other bits of Taverna. (assuming APIs are not changed).
Maven will by default check and download new versions of JARs that are in
-SNAPSHOT version, in particular if the JARs in
.m2/repository is older than 24 hours. For Taverna these will come from http://www.mygrid.org.uk/maven/snapshot-repository/ - where new versions are deployed every night by the automatic build system.
The advantage of this is that you don't need to recompile modules you are not developing, but you would still get the changes committed by others to Subversion. So if you are developing the Beanshell activity, and another user is developing the Biocatalogue perspective, you would get the committed changes to Biocatalogue without re-building the biocatalogue module. However, if the BioCatalogue commit broke the build, the automatic build system would not deploy any snapshots that night.
This means that you could continue working even if the Subversion code is in a bit of flux - the official snapshots will always be from the last known working build.
|Forcing new snapshots to be downloaded|
If your project is not using the affected module, you might need to run Maven install again on the
If you are editing several modules, but have not committed your changes, and it's been more than 24h since you compiled your modified module, Maven could download a "newer" version from the myGrid snapshot repository, and your changes would no longer be active. To avoid this, you should start the day by recompiling "your" modules, or all of Taverna.
The disadvantage of the developer build is that it can't be shared with anyone else, as they would not have the code from your
/home/johndoe/.m2/repository. If you gave them the installation folder, Taverna would probably still work, but it would take quite a while to start up, as it would download everything from the listed Maven repositories, including nightly built snapshots of Taverna modules - which might not include your changes.
To build a snapshot distribution from Eclipse, expand
products/net.sf.taverna.t2.taverna-workbench/workbench-distro and select Run as -> Maven build...
Again use the Goals
clean install, but also set the Profiles to
Click Apply and Run. This time the build of workbench-distro will take a while longer, as Maven is constructing the
repository folder with all the required libraries, and producing a distribution zip file.
|The "release" profile|
There's a third profile called
Once the build is successful, the Console should say something like:
The distribution in
target/taverna-nightly-2.3-SNAPSHOT-20101111-bin.zip should now be equivalent to the nightly build we started with, with all required JARs in its
repository folder. You may share this build with other users to test your particular build.
|Is every dependency included?|
If the external dependencies of Taverna has changed, the Maven plugin that is populating the
Due to the way the Raven plugin system works, the bundled
Now that we know we are able to compile and run Taverna, we can import Taverna modules into Eclipse so that we can play with the source code.