Tuesday, September 25, 2012

Using Cloudbees behind a proxy

At work, we are sitting behind a proxy. This can be pretty annoying if you have to use services that require the internet, but don't rely on your internet settings. For example Maven, which can be configured using it's settings.xml file, or the Cloudbees SDK.

That last one is a bit trickier to use behind a proxy. There is no obvious settings.xml or properties file where you can define your proxy server. The solution, however, is very simple. Go to your Cloudbees SDK root folder, and edit the bees.bat file. Change the JAVA_OPTS to the following:
JAVA_OPTS=-Dbees.home=%BEES_HOME% -Dhttp.proxyHost=<your proxy host> -Dhttp.proxyPort=<your proxy port> -Xmx256m
Save the changes, and when you run the bees command from the console now, it will use your proxy settings. Easy as that!