loading table of contents...

6.2. Build Process

CoreMedia Studio provides artifacts for use with Maven. Since CoreMedia Studio builds upon Jangaroo, its build process is basically identical to Jangaroo's. The Jangaroo compiler documentation explains how to use the Jangaroo tools from the command line and how to use them with Ant or Maven. This covers the conversion from EXML to ActionScript and further down to Ext JS.

A detailed description of the Jangaroo build process with Maven is given in the Jangaroo tools wiki.

In the following section, you will find a description of some of the typical use cases that appear during CoreMedia Studio development using the CoreMedia Project workspace.

Compiling the Studio Project

Open a command line at the CoreMedia Project root directory. To compile all Studio modules, change to the modules/studio/ directory and run

mvn clean install

This will remove all generated files before starting the compilation. To only recompile updated files, run

mvn install

Running the Studio Web Application

In the modules/studio/studio-webapp/ directory of CoreMedia Blueprint, you can start the Studio web application in a Tomcat servlet container via Maven, like so:

mvn tomcat7:run

The recommended way of dynamically reassigning the server URLs that you want Studio to connect to is to add one or several Maven profiles to your local settings.xml, that redefine connection properties as follows:

<profile>
  <id>myStudio</id>
  <properties>
    <installation.host>myserver.mycompany.com</installation.host>
    <database.host>mydatabase.mycompany.com</database.host>
    <solr.host>mysolr.mycompany.com</solr.host>
    <mongo.db.host>mymongoserver.mycompany.com</mongo.db.host>
  </properties>
</profile>

You can then start your local Studio development web application by running

mvn -PmyStudio tomcat7:run

When only EXML and ActionScript files are recompiled from within IntelliJ IDEA, the Tomcat servlet container automatically serves the updated compiled class files. There is no need to stop and restart Tomcat.

In contrast, before recompiling any Java files, make sure to kill the Tomcat process. The Java Virtual Machine might not be able to load additional classes when JAR files are modified concurrently.

Configuring the Build Process

The Jangaroo compiler can be configured to check whether compiled code uses non-public API. To this end, the parameter publicApiViolations of the Jangaroo Maven plugin controls how the compiler handles usages of non-public API classes in your project code. The parameter can take the values warn to log a warning whenever such a class is used, allow to suppress such warnings, and error to stop the build with an error. The default value is warn, but you can set it to error as follows:

<plugin>
  <groupId>net.jangaroo</groupId>
  <artifactId>jangaroo-maven-plugin</artifactId>
  <configuration>
    <publicApiViolations>error</publicApiViolations>
  </configuration>
</plugin>

Example 6.1. Detecting public API violations