Skip to end of metadata
Go to start of metadata

This is part of the tutorial Tutorial - Service invocation plugin

Create project from Maven archetype

In the Java perspective (recommended over the Java EE perspective), select File -> New -> Project....

In the dialogue, select Maven -> Maven project:

Make sure Create a simple project is not ticked in the first screen of the New Maven Project wizard and click Next >.

In newer versions of the m2eclipse plugin the Separate projects for modules tickbox is not available. This should not affect the tutorial.

From the Select an Archetype screen, we'll need to add the myGrid archetype catalog. Click Configure....

From the Maven archetypes catalogs setting, click Add Remote Catalog... and add the catalog file:

Name the catalog myGrid.

Click Verify... and then OK to add the catalogue.

Remote catalog is empty
If you receive the error message Remote catalog is empty, this is most likely due to a bug in the m2eclipse plugin in v0.12.x, MNGECLIPSE-2757

Until m2eclipse 0.13.x or newer are released, there are two possible workarounds:

Click OK in the "Preferences" dialogue.

Now you should be able to find myGrid in the Catalog dropdown list. 

Select the taverna-activity-archetype from the list. (At time of writing this is at version 1.3). 

Next, fill in details for group id, artifact id, version number and package name. As these will identify your plugin and also will be part of the workflow definitions using your plugin, it is important that you follow the Java guidelines for package names to avoid conflicts with other plugins. 

So if you work in the IMG group in Computer Science at University of Manchester, and this plugin will connect your software MyFancyTool with Taverna, then you could use a group id uk.ac.manchester.cs.img.myfancytool, artifact id myfancytool-taverna and package name uk.ac.manchester.cs.img.myfancytool.taverna (and so also avoid conflicts with your existing code using the package name uk.ac.manchester.cs.img.myfancytool). As this wizard will generate several modules for your Taverna activity, you will find it useful for them to have a common group ID that at least includes your tool or activity/service type name. 

As you most likely don't work for the IMG group, you can use values like group ID com.example and artifact id example for this tutorial.

Tweaking the class names
It is possible to modify the property classPrefix - by default this is Example - meaning it will generate classes like ExampleActivity and ExampleActivityConfigurationBean. You can modify this property if you are making a real activity, in which case your class names should reflect the real purpose. You could for instance set the class prefix to Corba to generate CorbaActivity and friends.
Property classPrefix is missing
The first time you run this wizard, m2eclipse will not yet have downloaded the Taverna archetype, and might not populate the classPrefix property correctly, leading to an error message like:

The simple workaround is to just try again - this time the classPrefix property should appear in the list. If it is still missing - add it with the value Example and try again.

Click Finish and the Eclipse status bar should say 'Creating taverna-activity-archetype' and 'Updating Maven Dependencies'. If this is the first time you deal with Taverna libraries, Maven will download the necessary dependencies to compile and run this example, these could be about 40 MB, and would be stored in .m2/repository in your home directory. If you already have Taverna installed, you can give Maven a headstart by copying in the full content from the repository folder of the Taverna installation directory, like from C:\Program files\Taverna workbench 2.1\repository to C:\Users\stian\.m2\repository - you should notice that the folder structure is similar, organized by groupId, artifactId and version.

Failed to create project
 
Due to a bug in the Eclipse plugin m2eclipse 0.10.0, MNGECLIPSE-2110 (seems fixed in 0.10.2), you might get an error message:

The simplest workaround for this particular bug is to upgrade to m2eclipse 0.10.2. Note that due to another bug in 0.12.x you should install 0.10.2 from a different plugin site.

Alternatively, you can use the command line version of Maven for creating the project. (see Prerequisites). Afterwards you may import the project into Eclipse to continue the tutorial as normal.

Go to the folder for your Eclipse workspace, then run this command (all on one line without the trailing backslashes):

Maven should generate the archetype in the folder myfancytool-taverna:

Now, to import this project into Eclipse, do File -> Import... and select Maven->Existing Maven Projects. Browse to the new folder, and tick so that the project and sub-modules are selected, and click Finish.

After this you should get three new projects in your Package explorer, example, and two sub-projects example-activity and example-activity-ui.

myfancytool-taverna is the parent project, expand it and you will see one folder for each module, example-activity and example-activity-ui. As the two counterparts modules have different dependencies and source code, they are imported as two extra projects in Eclipse, but their file content is still kept inside their parent project, in this case myfancytool-taverna:


This is part of the tutorial Tutorial - Service invocation plugin

Labels

tutorialservice tutorialservice Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.