>A Maven/Tycho Experiment

>Regardless of which build system you choose, there will be a learning curve. How much of a curve can greatly depend on how the build system behaves. If it is Ant based, it is going to be pretty verbose. If it is Maven or Buildr based, the verboseness is replaced by terseness and sometimes cryptic configuration files.

With this said, I recently decided that the PsychoPath XPath processor needed to migrate off of the Athena Common build script that it had been using to a Maven based build. The reason was two fold:

  1. I needed the ability to generate and eventually host a Maven repository for PsychoPath to help make it available outside of eclipse. PsychoPath is just a bundle, but doesn’t have specific OSGI dependencies so can be used outside of osgi container.
  2. Portability of the build script. While Athena itself is pretty portable, the underlining eclipse base builder, and the assumptions it makes on project configuration and layout can be difficult to work with at times and can be very system dependent.
  3. Speed. Even with PsychoPath, it takes on average 20 minutes to run the build, and test using Athena Common Builder. Much of this is due to the way the base builder and Athena setup the target platform.

Robert Munteanu, answered a twitter call to help get PsychoPath setup using Maven 3 and Tycho. The results can be found on the GitHub fork of the eclipse code. The results were pretty impressive.

  1. Average build time for Psychopath is number under 2 minutes.
  2. Test runs went from an average of 2 minutes to 46 seconds. This is still running all of the 8306 unit tests.
  3. A P2 update site is created and available for consumption and Maven repos are available as well.
  4. Pointing to which P2 repositories were needed and what dependencies to install was just a matter of adding the appropriate repository urls. Tycho figured out the dependencies and built just what was needed to build and run the tests.

A Maven based build is not without its disadvantages. In particular the fact that it downloads the Internet. However after the initial download and unless your upstream dependencies change it only needs to do this once. Nick has done some improvements to Athena in this area, but the reconstruction of the target platform and the p2 provisioning is the longest running portion of an Athena build. Almost half the time of the build is spent during provisioning.

After Helios is out, and things have settled down again. I’ll be migrating Robert’s contribution back into the main PsychoPath code base. The Hudson based build will be updated to use the new Maven build for the CI builds.

One item I have not yet figured out how to do correctly with Tycho and Maven, is to include Code Coverage plugins like Emma and Cobertura in the builds. The Instrumentation always seems to happen after the Tests have been run from the test plugin and not before the Test has been run. Any insights on how to get Instrumentation working correctly with Tycho would be appreciated.

Updated June 8, 2010: Information on using Emma using ECLEmma headless can be found here.

Updated July 8, 2010: Updated information on using ECLEmma with Tycho/Maven3 has been posted on the Sonatype wiki, “How to integrate EMMA with Tycho”.

This entry was posted in build, eclipse, maven, osgi, tycho. Bookmark the permalink.

5 Responses to >A Maven/Tycho Experiment

  1. Jesper says:

    >Great news!How big is the CVS -> Git checkout gain?For a project like the PsychoPath tests which has many many directories and files, the gains from ditching CVS to something snarter (Subversion, Git, etc) should be noticeable by itself."And I, for one, welcome any new non-CVS SCM overlord" (to paraphrase Kent Brockman)

  2. NarZo says:

    >"A Maven based build is not without its disadvantages. In particular the fact that it downloads the Internet"Using a repository manager (Nexus, Archiva, Artifactory) is a best practice and remove this issue.

  3. Le ScaL says:

    >Note that in this case, what is downloaded is just what you need since it actually is the p2 resolver that is run to figure out the OSGi dependencies.So if you download the internet it is probably because you said you needed it :).

  4. David Carver says:

    >@Jesper the speed difference for the PsychoPath project in terms of checkout,update, and difference comparison is 100x faster using git than with CVS. It's just blazingly fast. See my fork at GitHub.http://github.com/kingargyle/PsychoPath-XPath-2-ProcessorThere is an xpath2proj branch.@La Scala and @NaZro yeah I realise that it is getting what it is being requested. I'll take a look into Nexus one at some point.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s