Getting Started

Examples of how to use Maven support for ABS can be found at the Tools/ABS/trunk/abs-packages of the HATS svn repository.

An ABS Maven module is organised in the following directory structure

my-app
|-- pom.xml
`-- src
    |-- main
    |   `-- abs
    |       `-- App.abs 
    |           
    `-- test
        `-- abs
            `-- AppTest.abs

This is the standard layout for ABS Maven projects. The application sources reside in $basedir/src/main/abs and test sources reside in $basedir/src/test/abs, where $basedir is the directory containing pom.xml.

pom.xml contains the Project Object Model (POM) for this project. The POM is the basic unit of work in Maven, it is a xml file that declares the following information:

  • The identifier of the ABS Maven project
  • The 'dependencies', that is, other (ABS) Maven projects the project requires
  • How to compile (generate backend codes from) the source of the ABS Maven project
  • How to package the source of the ABS Maven project
  • How to test the source of the ABS Maven project
  • How to deploy the packaged ABS Maven project into a (remote) repository

ABS Maven POM

For ABS Maven project, the pom.xml would look similar to the following (accessing http://tools.hats-project.eu/maven-repos requires a private key, consult Jan for more information.)

<project>
  ...
  <repositories>
    <repository>
      <id>repos.hats-project.eu</id>
      <url>http://tools.hats-project.eu/maven-repos/</url>
    </repository>
  </repositories>
  ...
  <pluginRepositories>
    <pluginRepository>
      <id>repos.hats-project.eu</id>
      <url>http://tools.hats-project.eu/maven-repos/</url>
    </pluginRepository>
  </pluginRepositories>
  ...
  <build>
    <sourceDirectory>src/main/abs</sourceDirectory>
    <testSourceDirectory>src/test/abs</testSourceDirectory>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>eu.hats-project</groupId>
        <artifactId>abs-maven-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        ... (see other usage or goals for details) ...
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>