APAM/APAM Getting Started Tutorial/APAM Project Creation

From Wiki Adele Team
< APAM‎ | APAM Getting Started Tutorial
Revision as of 12:23, 10 January 2013 by Mehdi (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This APAM Wiki is no longer maintained. Please switch to the following github Wiki for newest APAM information:

For building APAM projects we use the Apache Maven project management software. Maven compiles the Java code, adds the appropriated metadata to the components and creates OSGi standard bundles (jar files). To have an idea about Maven you can follow the Maven in 5 minutes tutorial.

Project Structure

An APAM project should follow this structure :

  src/main/java : java sources files of the project.
  src/main/resources/metadata.xml : APAM descriptor file.
  pom.xml : maven script file.

A sample project structures is shown in next image:


Sample Maven Script File

This file is used to describe the project, information to be used is:

  • identification : project name, version, type of packaging, etc.
  • repository : repository of artifacts to be used in compilation task.
  • dependencies : project dependencies (if needed)
  • build: the target platform of APAM is OSGi, then the build process includes the maven-bundle-plugin and the ApamMavenPlugin like they are used in this sample pom file.

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <!-- Project Identification -->
  <name>Hello World Specification</name>

  <!-- Repositories List -->

  <!-- Dependencies Description-->

  <!-- Build Description-->

Project Build

To build an APAM project with maven use this command in a OS console:

  mvn clean install

You can also use a pluging for your IDE as M2Eclipse.