Mondrian doesn't ship with a WAR file by default anymore. This inhibits people from trying out Mondrian via its XML/A servlet.

What is Mondrian?

Mondrian is like a database driver for MDX (OLAP) queries. OLAP is an analytical pattern for designing data warehouses and data-marts. MDX is an SQL like query syntax for getting information from OLAP designed datasources. MDX was invented by Microsoft and is somewhat standardized by the wider community.

So, Mondrian basically translates MDX queries into any number of SQL queries and aggregates the results. Now, Mondrian is basically a Java library, so you get the results as Java objects. The XML/A servlet as a part of the Mondrian project returns the results to you via SOAP. XML/A is a standard to structure MDX/OLAP interactions with SOAP.

The xmondrian Project

Roland Bouman started the xmondrian project on Github, a WAR file built with mondrian plus some other OLAP and XML/A projects. But, the project doesn't have any sources for the build process. Since this project is a bit old, and only has 1 binary release, it's not up-to-date anymore. I wanted to re-invent this project and deliver a stock mondrian WAR file and a WAR file bundled with all the extras included in xmondrian.

My new project is at:

Building on Top of Docker

Using docker quickly gets me a Java environment. Automating the installation of a JDK is quite troublesome because of the license that you have to accept to download directly from Oracle (nee Sun).

FROM maven:3.5-jdk-8-alpine
RUN apk update && apk add git

VOLUME ["/app", "/war-skeleton", "/xwar-skeleton", "/maven"]

ENTRYPOINT ["/bin/sh"]

This just pulls down a maven docker image and exposes 4 directories that we can attach to our local drive with volumes.

The war-skeleton and xwar-skeleton give you the files and directory structure to configure your own war file and add in whatever you want. Currently, it only adds xmla4js to the root of the WAR. xmla4js is another project by Roland Bouman which handles all the SOAP and AJAX interaction with Mondrian's XML/A servet. (it doesn't create MDX for you).

Building the WAR

docker build -t markkimsal/mondrian-war-build:latest .
sh ./ xmondrian

First, download the maven alpine image and expose the 4 volumes and tag it so you can refer to it without the randmon hash. Next, run the file to run the new image with all the connected volumes. You can pass the flag xmondrian or not to get the additional projects in your war.

The resulting WAR file will have a web.xml that exposes the XML/A servlet at the path /xmla.

Not all of the xmla4js sample pages work because some of them are hardcoded to hit /xmondrian/xmla as a path. You can configure your web.xml to expose the WAR at any path, or you can simply rename the war file before deploying it to Jetty.

Building with Maven

The heart of Mondrian's build process is maven and the parent-poms. You have to checkout the maven-parent-poms project and then checkout mondrian under pentaho-ce-jar-parent-pom/pentaho-ce-jar-parent-pom. From there, mvn -DrunITs install.

Deplying the WAR to Jetty

Simply move the resulting mondrian.war or xmondrian.war to your Jetty's webapps/ directory and run java -jar start.jar.

3 Files to Configure Mondrian + Jetty

In theory, you can do this in with 2 files, but I didn't get it to work. First, you need to tell Jetty to "override" the web.xml that is compiled into the WAR file. (It doesn't seem to override the file, but rather merge the contents).

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="war">webapps/xmondrian.war</Set>
    <Set name="overrideDescriptor"><SystemProperty name="jetty.home" default="."/>/mondrian-web.xml</Set>

This allows you to put your own web.xml right in the jetty root (or maybe you should put it under etc/) - but not in the webapps folder.

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns=""
  version="3.1" metadata-complete="true">
     Mondrian XML/A servlet, sample schemas and datasets, and client libraries and tools.
      Provides a XML/A (XML for Analysis) interface to the Mondrian (R)OLAP engine.
      These are other classes that implement a XML/A provider servelt on top of Mondrian.


    This parameter is commented out intentionally;
    this way, mondrian will assume the default location for the data source configuration
    The default location is WEB-INF/datasources.xml



Now you can specify your datasources. Make sure you put your mysql-connector-java-5.1.39.jar into lib/ext/ of Jetty.

<?xml version="1.0"?>
    <DataSourceDescription>Foodmart Sample Data</DataSourceDescription>
	<DataSourceInfo>Provider=mondrian;  JdbcUser=docker; JdbcPassword=mysql; Jdbc=jdbc:mysql://;JdbcDrivers=com.mysql.jdbc.Driver</DataSourceInfo>
        <Catalog name="FoodMart">

The Projects

Mondrian WAR project is at:


xavier (Web GUI charts):

outdated xmondrian:

Pentaho Parent POMs: