fabric3
Content
Documentation
Developer Reference
Packaging
Service Delivery
Fabric3 Maven Assembly Plugin
Fabric3 Maven Assembly Plugin
search
attachments
weblink
advanced
image-effects
image-attributes
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
Colour picker
More colours
Formatting
Strikethrough
Subscript
Superscript
Monospace
Clear formatting
Bullet list
Numbered list
Task list
Outdent
Indent
Align left
Align center
Align right
Page layout
Link
Table
Insert
Insert content
Files and images
Link
Symbol
Emoticon
Markup
Horizontal rule
Insert macro
User mention
Jira Issue/Filter
Info
Status
Gallery
Table of Contents
Jira timeline
Lucidchart Diagrams
Trello Board
Other macros
Page layout
No layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Find/Replace
Keyboard shortcuts help
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account.
<p>The Fabric3 assembly plugin is used to create a runtime image as part of an automated, reproducible Maven build process. The plugin downloads the Fabric3 standalone runtime as well as required profiles and extensions and application contributions. In addition, it can apply custom configuration to the runtime image. The Fabric3 assembly plugin will use these artifacts to create a runtime distribution complete with installed application contributions. During a Maven release process, the runtime image can be uploaded to a Maven repository where it can be accessed by IT automation software during system deployment.</p><h2>Plugin Setup</h2><p><span style="line-height: 1.4285715;">When executed, the Fabric3 assembly plugin will place the resulting runtime image in the </span><code style="line-height: 1.4285715;">project.build.directory/image</code><span style="line-height: 1.4285715;"> directory. The Fabric3 assembly plugin is typically used in conjunction with the Maven assembly plugin to produce a compressed archive. This can be done as follows:</span></p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><plugins> <plugin> <groupId>org.fabric3</groupId> <artifactId>fabric3-assembly-plugin</artifactId> <version>${fabric3.version}</version> <executions> <execution> <id>fabric3-assembly</id> <goals> <goal>fabric3-assembly</goal> </goals> </execution> </executions> <configuration> <runtimeVersion>${fabric3.version}</runtimeVersion> <contributions> <dependency> <groupId>org.fabric3.samples</groupId> <artifactId>gateway</artifactId> <version>${app.version}</version> </dependency> <contributions> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>${assembly.version}</version> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </pre></td></tr></table><p>The Maven <code>assembly.xml</code> will then compress the runtime image into a ZIP file:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-parameters="language=html/xml" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9aHRtbC94bWx9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><assembly ....> <id>bin</id> <baseDirectory>${project.build.directory}</baseDirectory> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <outputDirectory>/</outputDirectory> <directory>${project.build.directory}/image</directory> </fileSet> </fileSets> </assembly> </pre></td></tr></table><h2>Adding Contributions</h2><p>Contributions are added using the <code>contributions</code> element of the plugin <code>configuration</code> as shown in the previous example. Note that the order of the contributions is not important: at startup, Fabric3 will introspect and order the contributions based on declared dependencies such as Java package imports (for details of dependency ordering, see <a class="confluence-link" href="/wiki/spaces/FABRIC/pages/524356/Contribution+Modularity" data-linked-resource-id="524356" data-linked-resource-version="6" data-linked-resource-type="page" data-linked-resource-default-alias="Contribution Modularity" data-base-url="https://fabric3.atlassian.net/wiki">Contribution Modularity</a>). </p><p> </p><p>By default, contributions are installed in the VM runtime image (i.e. under <code>runtimes/vm/deploy</code>). If they should be deployed to the controller or another runtime configuration, use the <code>contributionTarget</code> element:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><plugins> <plugin> <groupId>org.fabric3</groupId> <artifactId>fabric3-assembly-plugin</artifactId> ... <configuration> <runtimeVersion>${fabric3.version}</runtimeVersion> <contributionTarget>controller</contributionTarget> <contributions> <dependency> <groupId>org.fabric3.samples</groupId> <artifactId>gateway</artifactId> <version>${app.version}</version> </dependency> <contributions> </configuration> </plugin> ... </plugins> </pre></td></tr></table><p> </p><p><span style="font-size: 20.0px;line-height: 1.5;">Adding Configuration</span></p><p>Typically you will need to add runtime configuration to the produced image. This can be done by creating a <em>systemConfig.xml</em> file in the Maven module <code>source</code> directory and including it in the plugin configuration under <code>configurationFiles</code>:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><plugins> <plugin> <groupId>org.fabric3</groupId> <artifactId>fabric3-assembly-plugin</artifactId> <version>${fabric3.version}</version> ..... <configuration> <runtimeVersion>${fabric3.version}</runtimeVersion> <configurationFiles> <copy> <source>../../../config/security.xml</source> <destination>runtimes/vm/config</destination> </copy> </configurationFiles> </configuration> </plugin> </plugins></pre></td></tr></table><p>When creating a production system remember to disable the contribution directory scanner in <em>systemConfig.xml</em> by declaring a production runtime:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><config> ... <scanner production="true"/> </config></pre></td></tr></table><h2>Profiles and<span style="line-height: 1.5;"> Extensions</span></h2><p>Specifying profiles and extensions to include in the runtime image is done using the <code>profiles</code> and <code>extensions</code> elements respectively:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><plugins> <plugin> <groupId>org.fabric3</groupId> <artifactId>fabric3-assembly-plugin</artifactId> <version>${fabric3.version}</version> <executions> <execution> <id>fabric3-assembly</id> <goals> <goal>fabric3-assembly</goal> </goals> </execution> </executions> <configuration> <runtimeVersion>${fabric3.version}</runtimeVersion> <profiles> <!-- JMS support --> <profile> <groupId>org.fabric3</groupId> <artifactId>profile-jms</artifactId> <version>${fabric3.version}</version> </profile> <!-- JAX-RS support --> <profile> <groupId>org.fabric3</groupId> <artifactId>profile-rs</artifactId> <version>${fabric3.version}</version> </profile> </profiles> <!-- add contributions --> <contributions> <dependency> <groupId>org.fabric3.samples</groupId> <artifactId>gateway</artifactId> <version>${app.version}</version> </dependency> <dependency> <groupId>org.fabric3.samples</groupId> <artifactId>backend</artifactId> <version>${app.version}</version> </dependency> </contributions> <!-- overlay configuration --> <configurationFiles> <copy> <source>../../../config/security.xml</source> <destination>runtimes/vm/config</destination> </copy> </configurationFiles> </configuration> </plugin> </plugins> </pre></td></tr></table><h3><span>Excluding Extensions</span></h3><p>Runtime extensions included as part of the standard standalone runtime distribution can be removed using the <code>removeExtensions</code> element:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" data-macro-schema-version="1" style="background-image: url(https://fabric3.atlassian.net/wiki/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6eG1sfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><plugins> <plugin> <groupId>org.fabric3</groupId> <artifactId>fabric3-assembly-plugin</artifactId> ... <configuration> <runtimeVersion>${fabric3.version}</runtimeVersion> <!-- add contributions --> <contributions> <dependency> <groupId>org.fabric3.samples</groupId> <artifactId>gateway</artifactId> <version>${app.version}</version> </dependency> <dependency> <groupId>org.fabric3.samples</groupId> <artifactId>backend</artifactId> <version>${app.version}</version> </dependency> </contributions> <!-- overlay configuration --> <removeExtensions> <dependency> <groupId>org.fabric3</groupId> <artifactId>fabric3-management-jmx</artifactId> <version>${app.version}</version> </dependency> </removeExtensions> </configuration> </plugin> </plugins> </pre></td></tr></table><p> </p><p> </p>
Save
Close
Edit
Preview
View changes
Revert to last published version
{"serverDuration": 470, "requestCorrelationId": "ac4f2d85fb16423ca712f69d6824663c"}