FraSCAti Maven plugins

Description

For convenience, FraSCAti provides plugins (MOJO) for Maven users, allowing to:

  • parse SCA composite files,

  • instantiate SCA components,

  • call a service/method on SCA components.

You can use FraSCAti Maven plugins either in the main build step of your build process or in a dedicated Maven profile.

FraSCAti compiler plugin

Overview

This MOJO can be used to parse one or several SCA composite descriptors, generate code and compile it. Then, you can use the FraSCAti launcher plugin to run your application.

Here is an example of a default configuration for this plugin:

<build>                                             
  <defaultGoal>org.ow2.frascati.mojo:frascati-compiler-plugin:1.4:exec</defaultGoal>
  <plugins>                                                                                    
    <plugin>                                                                                                         
      <groupId>org.ow2.frascati.mojo</groupId>                                                                    
      <artifactId>frascati-compiler-plugin</artifactId>                                                               
      <executions>                                                                                                   
        <execution>                                                                                                  
          <id>compile-composite</id>                                                                                     
          <phase>generate-sources</phase>                                                                                     
          <goals>                                                                                                    
            <goal>compile</goal>                                                                                        
          </goals>                                                                                                   
        </execution>                                                                                                 
      </executions>                                                                                                  
      <configuration>                                                                                                
        <loggingConfFile>${logging.conf.file}</loggingConfFile>                                                      
        <composite>${composite.file}</composite>                                                                     
      </configuration>                                                                                               
    </plugin>                                                                                                        
  </plugins>                                                                                                         
</build>

An alternative configuration to parse several files:

<configuration>                                                                                                
  <loggingConfFile>${logging.conf.file}</loggingConfFile>                                                      
  <composites>                                                                     
    <composite>first.composite</composite>
    <composite>second.composite</composite>
  </composites>
</configuration>

Parameters

The FraSCAti compiler MOJO can be configured with following parameters:

  • loggingConfFile [optional]: a logging configuration file. A default configuration file is provided at

  • composite [required]: the SCA composite file to load. Can be a path, a resource available in the classpath, or an URL.

FraSCAti launcher plugin

Overview

This MOJO can be used to run your SCA applications such as running an SCA composite in a server mode (if providing services for instance) or invoking services on loaded SCA composites. It is also able to parse and compile your SCA descriptors if you didn't used the compiler plugin before.

Here is an example of a default configuration for this plugin:

<build>                                             
  <defaultGoal>org.ow2.frascati.mojo:frascati-launcher-plugin:1.4:exec</defaultGoal>
  <plugins>                                                                                    
    <plugin>                                                                                                         
      <groupId>org.ow2.frascati.mojo</groupId>                                                                    
      <artifactId>frascati-launcher-plugin</artifactId>                                                               
      <executions>                                                                                                   
        <execution>                                                                                                  
          <phase>package</phase>                                                                                     
          <goals>                                                                                                    
            <goal>exec</goal>                                                                                        
          </goals>                                                                                                   
        </execution>                                                                                                 
      </executions>                                                                                                  
      <configuration>                                                                                                
        <loggingConfFile>${logging.conf.file}</loggingConfFile>                                                      
        <composite>${composite.file}</composite>                                                                     
        <service>${service.name}</service>                                                                           
        <method>${method.name}</method>                                                                              
        <methodParams>${method.params}</methodParams>                                                                
      </configuration>                                                                                               
    </plugin>                                                                                                        
  </plugins>                                                                                                         
</build>

Parameters

The FraSCAti launcher MOJO can be configured with following parameters:

  • loggingConfFile [optional]: a logging configuration file. A default configuration file is provided at

  • composite [required]: the SCA composite file to load. Can be a path, a resource available in the classpath, or an URL.

  • service [optional]: the name of the service to use.

  • method [optional/required if service is specified]: the name of the method to invoke. If no method is specified, the composite will be run in a server mode.

  • methodParams [optional]: method parameters specified in a single line and space-separated.

  • methodParameters [optional]: allows to define <methodParameter> children as individual parameters. All the text encapsulated in a <methodParameter> tag is considered as a single parameter.