Setting up a new Erlang/OTP project

Instead of an archetype for erlang-otp projects, the setup goal can be used to create some common default resources for your project.

When starting a new project, define a minimal POM with the following properties:

  • GROUP-ID
  • ARTIFACT-ID
  • VERSION
  • NAME
  • DESCRIPTION

    It would look something like this:

    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>[GROUP-ID]</groupId>
      <artifactId>[ARTIFACT-ID]</artifactId>
      <version>[VERSION]</version>
      <packaging>erlang-otp</packaging>
      <name>[NAME]</name>
      <description>[DESCRIPTION]</description>
      <build>
        <plugins>
          <plugin>
            <groupId>eu.lindenbaum</groupId>
            <artifactId>maven-erlang-plugin</artifactId>
            <version>1.0.0-beta</version>
            <extensions>true</extensions>
          </plugin>
        </plugins>
      </build>
    </project>

    Now executing mvn erlang:setup will run the setup goal and check for default resources and create those that are missing.

    At the end of the check, there will be an advice on plugins or dependencies that you manually have to add.

    Example output from the setup goal.

    Note that you can, at any time, run the goal again. Only missing files will be created an never replaced or overwritten.