Building Thirift on Ubuntu behind firewall

I was trying to build thrift on ubuntu and hit some issues, specially because my machine was behind the firewall. I am going to put down the steps to build thrift.
You need some more packages on your box and boost.

  • Dowload Boost
  • Building boost instruction are given on there site, but you can use following command to build the boost locally
  • ./
    ./ --prefix=/usr/local/boost_1_46_1
    ./bjam install
  • External packages required to build thrift can be done using following command
  • sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
  • Go to thrift directory where you have un-archived the source code
  • Build thrift using following command providing boost directory and JAVAC location
  • ./configure --with-boost=/usr/local/boost_1_46_1 JAVAC=/home/avinash/export/where/jdk/1.6.0_26/x86.linux/bin/javac
  • Upon completing successfull configuration, run make command
  • make

    If you are behind firewall you might hit error regarding downloading jars from maven repository.
    Maven tries to auto download the dependencies if they are not available within your local repository,
    since maven did not know of your proxy it was unable to download them and failed. Adding the
    proxy config to your maven settings.xml should resolve your problem when you box is behind firewall

  • Open your build.xml from your java directory
  • /home/avinash/work/thrift-0.9.0/lib/java/build.xml
  • Look for target
  • Add following proxy settings to your file
    <setproxy proxyhost="your proxy server name" proxyport="port number"/>
  • So new target looks like below
  •  <target name="" depends="setup.init,mvn.ant.tasks.check,proxy" unless="mvn.ant.tasks.found">
        <setproxy proxyhost="" proxyport="1234"/>
        <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${}/${mvn.ant.task.jar}" usetimestamp="true"/>

    This will solve your initial download issue but mvn.init target still give you issue while downloading maven depencies

  • If you already do not have settings.xml
  • Create it in your home folder under .m2 directory
  • Add following lines in the settings.xml file
  • <settings>
  • and run make again.