Category Archives: Maven

Jenkins slave building android maven project

Today I tried to add an android project to our Jenkins continuous integration system. Since it is build by maven, I didn’t expect any trouble. In order to build android apps, maven needs a manual installed android SDK, so I logged into the dedicated jenkins slave (a minimal amd64 linux system with no X11) and downloaded the SDK for linux, using wget. Since no direct internet traffic is allowed in our company, I had to use the proxy server.

The first problem arose when I tried to download the different platforms and components for android. Usually you download these parts by using a graphical tool, included in the SDK, but since this machine didn’t have any graphics configured, this won’t work. It took me some time to discover the parameter

--no-ui

, which runs the tool without a graphical interface. Now I tried

./android update sdk --no-ui

, but since the machine hadn’t a direct internet connection, the download of the components didn’t work. My attempts of defining the proxy with the usual linux way by setting the “http_proxy” variable or setting the java system proxy information by adding “-Dhttp.proxyHost=proxy -Dhttp.proxyPort=80” to the android script failed. Normally you would change the proxy information by using the graphical interface, but as told before it wasn’t available.

The solution I came up with, was using the proxy configuration file from a different machine. So I put the file androidtool.cfg containing the proxy settings in the /home/<user>/.android directory and voilà, downloading the platforms and components did work.

Nevertheless the maven build didn’t finish. Since the system was using amd64 libraries, the androidtool used by maven couldn’t find some libraries, it uses as 32bit versions. I just needed to install them with a short

apt-get install lib32z1 lib32gcc1

and everything worked like a charm. 🙂