Versions Compared

Key

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

...

Contribution Formats

Fabric3 applications are packaged in one or more contributions. Contributions can be a variety of formats. Fabric3 supports the following formats and can be extended to support others The following contribution formats are supported:

  • JAR archives
  • ZIP archives
  • WAR archives
  • OSGi bundles
  • XML documents 

JAR Contributions

Most SCA applications will be packaged as one or more JARs. In addition to including , which contain application classes and artifacts, a . A JAR -based contribution may contain an requires an contribution manifest file (sca-contribution.xml manifest file xml ) in the META-INF directory. The 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:

...

<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:sample="urn:tempuri.org">
   <deployable composite="sample:TheComposite"/>
</contribution>

Applications often require third-party libraries.  

Fabric3 supports two ways of packaging and deploying these libraries used by a contribution: 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  directory, which in turn will be made available on the contribution classpath. Imports are discussed in The Contribution Manifest.

WAR Contributions

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.

ZIP Contributions

ZIP contributions are identicle identical to JAR contributions.

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.

XML Documents

Fabric3 supports XML documents such as configuration files.

Gradle and Maven Plugins

Contributions will often use third-party libraries. These libraries may be packaged and deployed as separate contributions, which are then imported into the using contribution via OSGi directives (see Contribution Modularity). The downside of this approach is that deployment is more complex since an application is spread across multiple archives. For applications that do not need this degree of modularity, Fabric3 provides Gradle and Maven plugins for packaging third-party libraries within the contribution that uses them. 

The contribution plugin follows the same model as web application archives (WARs): it includes third-party library jars in META-INF/lib. At deployment, these libraries will be placed on the contribution classpath, thereby making them available to code bundled in the contribution.