Sunday, April 24, 2011

Recipe to build the Intalio Tempo project (Windows environment)

For those who want or need to build the Intalio Tempo project from its source, I am pretty sure you ended up reading the install instruction provided in the GIT repository from the Tempo project (if not, here's the link to it :

When I followed these instructions myself (FYI, I was trying to build the project in a Windows XP environment), I faced lots of problem (gem version problems, missing Ruby environment variables and so on) and at some point, I had the feeling that the instructions of the INSTALL.txt file were mainly UNIX/Linux oriented.

It took me a few days to figure out how to build the project in my Windows XP and here's the steps to go through : 

1° Prerequisites

First and foremost, make sure you've installed JDK 5 and set the JAVA_HOME variable.

2° Retrieving the Tempo project's source

The Tempo project source are located in a GIT repository. Personally, I've installed the Windows installer for te 1.7.4 preview version (

- Create a directory in C:/ and name it "Tempo-src"
- Open a GIT bash console and go into the "C:/Tempo-src" directory
- Execute the following command :
git clone git://

3° Installing Ruby for Windows

Download and install Ruby 1.8.7 for Windows (available at :

4° Installing development kit

- Download and install the development kit for Ruby. This will allow your gems, among other things, to execute C and C++ libraries. This kit is available at

Actually, the executable that you've just downloaded is a 7-zip archive. Run it, specify the extraction path to C:\devKit

(If you specify another path, make sure it does not contain any blank !!! That will prevent you from getting some errors that are far from being well documented)

- Open a CMD shell, go into the C:\devKit directory and execute the following commands :

          - ruby dk.rb init
     - ruby dk.rb install

5° Installing buildr gem
- Open a CMD shell and execute the command : gem install buildr -v 1.3.5 --platform=mswin32
This command will install the version 1.3.5 of buildr for Windows platform. During the installation process, you may get some error concerning the documentation file installation. Hopefully, these files are not necessary for the following steps.

6° Installing hpricot gem

In order to build the Tempo project, you'll also need the hpricot gem. In a CMD shell, simply execute the command gem install hpricot --platform=mswin32

Patching buildr

It seems that there are some version compatibility issues between the different tools. These issues are resolved by applying a patch on configuration file. For more information, you can refer to this link :

The link above described an automated procedure to apply the patch but it only works for UNIX/Linux platform. Working on Windows, I've simply edited the concerned configuration file manually. To make things simpler, just go into the C:\Ruby187\lib\ruby\gems\1.8\gems\buildr-1.3.3\lib\buildr\java directory. Open the file named version_requirement.rb and replace its content by the following lines :

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with this
# work for additional information regarding copyright ownership.  The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# License for the specific language governing permissions and limitations under
# the License.

module Buildr
  # See ArtifactNamespace#need
  class VersionRequirement
    CMP_PROCS = Gem::Requirement::OPS.dup
    CMP_REGEX = if defined?(Gem::Requirement::OP_RE)
 else { |k| Regexp.quote k }.join "|"

    CMP_CHARS = CMP_PROCS.keys.join
    BOOL_CHARS = '\|\&\!'
    VER_CHARS = '\w\.\-'

    class << self
      # is +str+ a version string?
      def version?(str)
        /^\s*[#{VER_CHARS}]+\s*$/ === str
      # is +str+ a version requirement?
      def requirement?(str)
        /[#{BOOL_CHARS}#{CMP_CHARS}\(\)]/ === str
      # :call-seq:
      #    VersionRequirement.create(" >1 <2 !(1.5) ") -> requirement
      # parse the +str+ requirement 
      def create(str)
        instance_eval normalize(str)
      rescue StandardError => e
        raise "Failed to parse #{str.inspect} due to: #{e}"

      def requirement(req)
        unless req =~ /^\s*(#{CMP_REGEX})?\s*([#{VER_CHARS}]+)\s*$/
          raise "Invalid requirement string: #{req}"
        comparator, version = $1, $2
        version = if defined?(Gem::Version.version) { |v| v.version = version }
        end, [$1, version])

      def negate(vreq)
        vreq.negative = !vreq.negative
      def normalize(str)
        str = str.strip
        if str[/[^\s\(\)#{BOOL_CHARS + VER_CHARS + CMP_CHARS}]/]
          raise "version string #{str.inspect} contains invalid characters"
        str.gsub!(/\s+(and|\&\&)\s+/, ' & ')
        str.gsub!(/\s+(or|\|\|)\s+/, ' | ')
        str.gsub!(/(^|\s*)not\s+/, ' ! ')
        pattern = /(#{CMP_REGEX})?\s*[#{VER_CHARS}]+/
        left_pattern = /[#{VER_CHARS}\)]$/
        right_pattern = /^(#{pattern}|\()/
        str = str.split.inject([]) do |ary, i|
          ary << '&' if ary.last =~ left_pattern  && i =~ right_pattern
          ary << i
        str = str.join(' ')
        str.gsub!(/!([^=])?/, ' negate \1')
        str.gsub!(pattern) do |expr|
          case expr.strip
          when 'not', 'negate' then 'negate '
          else 'requirement("' + expr + '")'
        str.gsub!(/negate\s+\(/, 'negate(')

    def initialize(op, *requirements) #:nodoc:
      @op, @requirements = op, requirements

    # Is this object a composed requirement?
    #   VersionRequirement.create('1').composed? -> false
    #   VersionRequirement.create('1 | 2').composed? -> true
    #   VersionRequirement.create('1 & 2').composed? -> true
    def composed?
      requirements.size > 1

    # Return the last requirement on this object having an = operator.
    def default
      default = nil
      requirements.reverse.find do |r|
        if Array === r
          if !negative && (r.first.nil? || r.first.include?('='))
            default = r.last.to_s
          default = r.default

    # Test if this requirement can be satisfied by +version+
    def satisfied_by?(version)
      return false unless version
      unless version.kind_of?(Gem::Version)
        raise "Invalid version: #{version.inspect}" unless self.class.version?(version)
        version = { |v| v.version = version.strip }
      message = op == :| ? :any? : :all?
      result = requirements.send message do |req|
        if Array === req
          cmp, rv = *req
          CMP_PROCS[cmp || '='].call(version, rv)
      negative ? !result : result

    # Either modify the current requirement (if it's already an or operation)
    # or create a new requirement
    def |(other)
      operation(:|, other)

    # Either modify the current requirement (if it's already an and operation)
    # or create a new requirement
    def &(other)
      operation(:&, other)
    # return the parsed expression
    def to_s
      str =" " + @op.to_s + " ").to_s
      str = "( " + str + " )" if negative || requirements.size > 1
      str = "!" + str if negative

    attr_accessor :negative
    attr_reader :requirements, :op
    def operation(op, other)
      @op ||= op 
      if negative == other.negative && @op == op && other.requirements.size == 1
        @requirements << other.requirements.first
      else, self, other)
  end # VersionRequirement

8° Building the Tempo project

And finally, in a CMD shell, execute the ruby command on the tempo-builder.rb file which is located in the C:\Tempo-src\tempo\rsc\scripts> directory :

At this point, if you got a message similar to "looking for TOOL_XXX (Axis2, Tomcat,and so on) and all I got was 404!", it is likely that the source of the Tempo project you've checked out are configured to work with previous version of the concerned tool.

So, you'll need to manually edit following file : C:\Tempo-src\tempo\rsc\scripts\lib\build_support.rb

To resolve this kind of issue, you could either change the version of change the path to the indicated resource. But my opinion is that it is safer to change the path and keep the same version. That way, you won't create new version incompatibilities.

9° External links

This recipe worked for me but if you still encounter errors following it, take a look at the Tempo development
group page ( where you will definitely find some helpful information. Here's another helpful link that will provide you plenty of information about Intalio Tempo :


No comments:

Post a Comment