#!/bin/sh # You should build the jar file with `ant jar`, then run this script if [ -z "$CA" ]; then CA=/tmp/cap/.keystore fi # Proxy parameters from # http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#Customization proxy_options() { # Do not add proxy options if there is no CA or no_proxy env is set if [ -z "$CA" ] || [ -n "$no_proxy" ]; then return fi echo -Dhttps.proxyHost=localhost echo -Dhttps.proxyPort=8008 echo -Djavax.net.ssl.trustStore=$CA } # Exit on errors set -e # Change dir to project cd "$(dirname "$(readlink -f "$0")")" jar=dist/TwitterDataAnalytics.jar # Build jar if missing [ -e "$jar" ] || ant jar java $(proxy_options) -jar "$jar" "$@"