Working with Service Assembly projects

Definition

There are two ways to create a service assembly for Petals.
You can either create a service-unit project and export it, or create a service assembly project (SA project).
A service assembly project only contains a JBI descriptor.
Such a project may reference service-unit projects (SU projects).

Here is the typical structure of a SA project.

src
   main
      java
      jbi
         jbi.xml
pom.xml

SA projects are associated with a builder in charge of validating the jbi.xml file.

Creation

The creation of a SA project can be achieved by:

  • Using the Petals Service Assembly wizard (File > New > Petals > Service Assembly project).
  • Generating concrete projects from a sketch project.
  • Importing an existing Service-Assembly.

A SA project makes sense in only two situations:

  • You want to package SU projects with Maven.
  • You want to create complex service assemblies, which embed several service-units.


To create a SA project, select File > New > Petals > Service Assembly project and click Next.


This wizard has only one page.


Fill-in the name and artifact ID.
Update the version and the group ID before click Finish.

A SA project is created and visible under the Service Assembly projects category.

Edition and update

A SA project has a specific structure when seen in the Petals Projects view.

SA Project
   SU Project 1
   ...
   SU Project n
   jbi.xml
   pom.xml


Notice the real file structure is:

SA Project
  src
     main
        jbi
           jbi.xml
  pom.xml


The Petals Projects view simply (and only) presents a different point of view.
To add or remove SU projects from a SA projects, you must edit the jbi.xml and (sometimes) update the dependencies in the pom.xml.
Once the jbi.xml is saved, a builder validates it and updates the project dependencies. The Petals Projects view is updated right after this build.

Export for Petals

SU and SA projects are compatible with the Petals Maven plug-in.
The packaging can be done with both the Studio and Maven.

Fast export

The fast export is a shortcut to create a service assembly from a SA project in few seconds.
The created service assembly is saved at the root of the SA project.

To export a SA project quickly, right-click it and select Petals > Fast Export for Petals.

Complete export

The complete export provides numerous options to export one or several SA projects at once.
Select File > Export > Petals > Service Assembly.


A wizard starts.
The top part lists all the SA projects contained in the workspace. Select the ones you want to export and the export mode.

Distinct export, in the project directories

Every selected SA project will be exported, each one as a service assembly.
Each created service assembly is placed in the SA project. This is equivalent to making a Fast export on every selected SA project.

Distinct export, in a same directory

Every selected SA project will be exported, each one as a service assembly.
All the service assemblies are placed in a same directory. The directory location must be specified.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.