The Maven Erlang Plug-In manages Erlang projects under Maven2, enabling building, testing and deployment - as expected by Maven users.
This project is based on the ideas of maven-erlang, created by Paul Guyot and Olivier Sambourg, but is maintained under this new regime in order to improve and extend it. This incarnation also provides a little bit more definition for development - be sure to check it out if you are interested in contributing.
The plug-in is available from the Sonatype OSS Repository https://oss.sonatype.org/. Add this to your POM plugins section:
... <plugin> <groupId>eu.lindenbaum</groupId> <artifactId>maven-erlang-plugin</artifactId> <version>1.0.0-beta</version> <extensions>true</extensions> </plugin> ...
Or you may check out the source code from the repository and install it locally.
svn co https://erlang-plugin.svn.sourceforge.net/svnroot/erlang-plugin/tags/maven-erlang-plugin-1.0.0-beta maven-erlang-plugin cd maven-erlang-plugin/ mvn install
This will build, test, package and install the plug-in.
To install the download version of the plug-in you need to extract the provided package and install the .jar artifacts with the following:
tar xzvf maven-erlang-plugin-1.0.0-beta.tar.gz
cd maven-erlang-plugin-1.0.0-beta
mvn install:install-file \
-Dfile=maven-erlang-plugin-1.0.0-beta.jar \
-DgroupId=eu.lindenbaum \
-DartifactId=maven-erlang-plugin \
-Dversion=1.0.0-beta \
-Dpackaging=jar
mvn install:install-file \
-Dfile=maven-erlang-plugin-1.0.0-beta-javadoc.jar \
-DgroupId=eu.lindenbaum \
-DartifactId=maven-erlang-plugin \
-Dversion=1.0.0-beta \
-Dpackaging=jar \
-Dclassifier=javadoc
mvn install:install-file \
-Dfile=maven-erlang-plugin-1.0.0-beta-sources.jar \
-DgroupId=eu.lindenbaum \
-DartifactId=maven-erlang-plugin \
-Dversion=1.0.0-beta \
-Dpackaging=jar \
-Dclassifier=sourcesTwo custom components are defined in the plug-in, and can be used by configuring the packaging type of a project.
Here is an example of the minimum required configuration for any project that wishes to use the Maven Erlang Plug-In:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>[your-gropupId]</groupId>
<artifactId>[your-artifactId]</artifactId>
<version>[your-version]</version>
<packaging>erlang-otp</packaging> <-- erlang-otp or erlang-rel
<build>
<plugins>
<plugin>
<groupId>eu.lindenbaum</groupId>
<artifactId>maven-erlang-plugin</artifactId>
<version>1.0.0-beta</version>
<extensions>true</extensions> <-- required
</plugin>
</plugins>
</build>
</project> This is the default directory structure that is supported for projects, and in part also generated, by the plug-in. Please note that some target folders that are common to Maven projects e.g. site are omitted in this listing.
BASE +-- src | +-- main | | +-- erlang (*.erl, *.app, *.appup, *.mib, *.funcs) | | +-- include (*.hrl) | | +-- priv (*) | | +-- resources | | | +-- priv (*) | | [+-- *] (other non-erlang source folders) | | | +-- test | +-- erlang (*.erl) | +-- include (*.hrl) | +-- resources (*) | +-- target (.dialyzer.ok) | +-- ebin (*.beam, *.app, *.appup) | +-- lib (dependency applications) | +-- include (*.hrl) | +-- mibs (*.bin) | +-- priv (*) | +-- surefire-reports (TEST-*.xml) | +-- test (*.beam, *.hrl) | [+-- *_src] (non-erlang source folders) | +-- pom.xml
The tables below shows how the plug-in goals are mapped to the Maven default lifecycle.
| Maven lifecycle phase | Goal in the Maven Erlang Plug-In |
| generate-sources | unpack-dependencies |
| generate-resources | copy-resources |
| compile | compile |
| generate-test-resources | copy-test-resources |
| test-compile | test-compile |
| process-test-classes | dialyzer |
| test | test |
| package | package |
| Maven lifecycle phase | Goal in the Maven Erlang Plug-In |
| generate-sources | unpack-dependencies |
| process-resources | copy-resources |
| compile | dialyzer-release |
| process-classes | prepare-release |
| package | package-release |
Provides the option to generate sensible defaults, replacing the need for a maven archetype.
More information: