Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The SCA manifest file contains contribution metadata , including a list of deployable composites. Deployable composites are those composites that are contained in the contribution which are to be deployed to a domain. A contribution may contain other composites but if they are not marked as deployable, they may not be directly included in the domain (i.e. they may only be used by a deployable composite). An example sca-contribution.xml file is shown below:used during deployment. The manifest file is used to specify:

  • A description
  • Deployable composites
  • Import and export directives
  • Extension points
  • Required capabilities
  • Native libraries
  • Excluded files

The following is an example manifest defining one composite to deploy:

 

Code Block
xml
xml
<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:f3="urn:fabric3.org" xmlns:sample="urn:tempuri.org" 
 description="A sample contribution">
   <deployable composite="sample:TheComposite"/>
</contribution>

Applications often require third-party libraries. Fabric3 supports two ways of packaging and deploying these libraries: by embedding them in the JAR; and importing them from another contribution. Similar to WARs, Fabric3 allows contribution JARs to bundle third-party libraries by placing their JARs in the META-INF/lib directory of the contribution. Any JAR placed in the META-INF/lib directory will be made available on the contribution classpath.

WAR Archives

Fabric3 supports packaging contributions as WAR files. WAR contributions behave like JAR contributions except the SCA manifest in is placed in WEB-INF. In addition, libraries and classes in WEB-INF/lib and WEB-INF/classes respectively are placed on the contribution classpath. WAR contributions are used for deploying web applications to a domain.

OSGi Bundles

Fabric3 also supports packaging contributions as OSGi bundles. In this case, OSGi bundle manifests may be used to export and import packages from other contributions. An SCA manifest file is not required.

Note Export-Package and Import-Package OSGi manifest headers are supported in a limited fashion. Specifically, attribute directives are not supported.

The Fabric3 Contribution Plugin

For Maven users, Fabric3 includes a contribution plugin that automates the process of embedding third-party libraries in a contribution. This plugin allows projects to specify a set of Maven modules which will be included in the META-INF/lib directory. The plugin automatically calculates and includes transitive dependencies as well. To use the contribution plugin, set the POM packaging element to sca-contribution-jar and add the plugin to the POM plugins section:

...

<build>
   <plugins>
      <plugin>
         <groupId>org.codehaus.fabric3</groupId>
         <artifactId>fabric3-contribution-plugin</artifactId>
         <extensions>true</extensions>
      </plugin>
   </plugins>
</build>

...

Description

A description may optionally be specified using the description attribute on the contribution element.

Deployable Composites

Deployable composites are those composites that are contained in the contribution which are to be deployed to a domain. A contribution may contain other composites but if they are not marked as deployable, they may not be directly included in the domain (i.e. they may only be used by a deployable composite). Deployable composites are specified using the deployable element.

Import and Export Directives

Import and export directives are used to share artifacts such as Java packages and XML documents across contributions. Imports and Exports are similar to the analogous OSGi directives (for Java packages they work exactly the same) except they extend beyond Java artifacts. For more details, see Contribution Modularity

Extension Points

Required Capabilities

Native Libraries

Excluded Files

Sometimes it is necessary to exclude contents of a contribution from being scanned. For example, generated XML files that contain invalid markup. Exclude patters can be specified using the <scan> element from the Fabric3 namespace in an sca-contribution.xml manifest with a REGEX pattern:

Code Block
xml
xml
<contribution ....>
   <f3:scan exclude=".*\.ds\.xml"/>
</contribution>