Cilia/Getting Started Tutorial/Project Creation

From Wiki Adele Team
Jump to: navigation, search

Creating a new project

For building Cilia 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

A Cilia project should follow this structure :

  src/java : java sources files of the project.
  src/resources/metadata.xml : Cilia 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, in Cilia project dependencies in Cilia Core and Cilia runtime are used suddenly.
  • build: the target platform of Cilia is OSGi, then the build process includes the maven-bundle-plugin and the maven-ipojo-plugin like they are used in this sample pom file.

<project xsi:schemaLocation=""
  xmlns="" xmlns:xsi="">

  <!-- Project Identification -->
  <name>Hello Mediator</name>

  <!-- Repositories List -->
      <name>Cilia - Release</name>
      <name>Cilia - Snapshot</name>

  <!-- Dependencies Description-->

  <!-- Build Description-->

Project Build

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

  mvn clean install

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