Packaging a release project

This example will show how to a release depending on one custom application project is packaged using the default local repository. Of course, this also applies to releases depending on several transitive application projects.

First of all we need a small application project. Our test project app consists of three modules. An application callback, a top-level supervisor and a test server.

Code for the application callback and the top-level supervisor.Code for the test server.

The application resource file and the application upgrade file app.appup for this application are listed below. Please note that we have to add the correct start module for non-library applications.
 {application, ${ARTIFACT},
   [{description, ${DESCRIPTION}},
    {id, ${ID}},
    {vsn, ${VERSION}},
    {modules, ${MODULES}},
    {maxT, infinity},
    {registered, ${REGISTERED}},
    {included_applications, []},
    {applications, [kernel, stdlib, sasl]},
    {mod, {app, []}},
    {env, []},
    {start_phases, []}]}.
 {${VERSION}, [], []}.

After that we package and install the application into the default local repository using mvn install. In case we would use a remote repository server like Sonatype Nexus the command mvn deploy must be used to deploy the artifact to the remote site.

Packaging and installing the application.

Now that the application is available to other projects we create the release project rel having a dependency to the app application. In our example the release pom.xml has the below content and the rest of the needed project infrastructure was generated using the setup goal mvn erlang:setup -DwithExtras=false.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
  <name>An erlang-rel release.</name>

Please note that we chose to build the release on Erlang/OTP R14B01 and that the erlang backend node on our machine runs this release of erlang. The generated relup file was altered to the minimalistic content {${VERSION}, [], []}.. Now packaging the release using mvn package will issue the following output.

Packaging the release project.

As can be seen the application dependency to app was resolved during the packaging process. The application package was extracted into the target/lib directory and the path was added to the code path of the backend node. The created release package rel-1.tar.gz can now be copied to a target system and installed using the standard erlang release handler as provided by the sasl application.