Package Dependencies

To specify which ABS packages an ABS eclipse project depends, specifies a .dependencies file in the project directory. This file is an XML file that is a Java properties file (a set of key/value entries) that can be read by the ABS eclipse plugin. Each pair's key specifies the absolute file path pointing the ABS package to be depended on, while the pair's value specifies a boolean, denoting if this entry is machine generated, and hence is read-only.

To generate package dependencies of an ABS eclipse project, one could use the abs-maven-plugin. This requires the ABS eclipse project to be also a Maven project, that is, a pom.xml is defined. The pom.xml specifies the Maven dependencies the project depends on, and it is these dependencies that one could use the abs-maven-plugin to derive the package dependencies

See Maven - Introduction to the Dependency Mechanism for more info.

Example

We use an ABS Maven project that defines the following pom.xml as an example.

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>a</groupId>
      <artifactId>b</artifactId>
      <version>c</version>
    </dependency>
    <dependency>
      <groupId>d</groupId>
      <artifactId>e</artifactId>
      <version>f</version>
    </dependency>
    <dependency>
      <groupId>g</groupId>
      <artifactId>h</artifactId>
      <version>i/version>
    </dependency>
  </dependencies>
  ...
</project>

Suppose Maven dependencies a:b:c and g:h:i points to ABS Maven modules. One can invoke the following Maven command:

mvn eu.hats-project:abs-maven-plugin:1.0-SNAPSHOT:configs

This command resolves these dependencies a:b:c and g:h:i to their physical file location and generate the following .dependencies file.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="absolute-file-path-to-a:b:c">true</entry>
<entry key="absolute-file-path-to-g:h:i">true</entry>
</properties>

This .dependencies file can then be read by the ABS eclipse plugin and adds them to package dependencies on the ABS project.