Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Cargo
Copy Page
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. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
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)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h3>Definition</h3><table class="wysiwyg-macro" data-macro-name="excerpt" data-macro-parameters="atlassian-macro-output-type=BLOCK" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2V4Y2VycHQ6YXRsYXNzaWFuLW1hY3JvLW91dHB1dC10eXBlPUJMT0NLfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Start a container that is not already running</p></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm99&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>This feature is only available for <a class="confluence-link" href="/display/CARGO/Local+Container" data-linked-resource-id="45798" data-linked-resource-type="page" data-linked-resource-default-alias="Local Container" data-base-url="http://docs.codehaus.org">local containers</a></p></td></tr></table><h3>Explanation</h3><p>First you need to create a <a class="confluence-link" href="/display/CARGO/Container+Instantiation" data-linked-resource-id="13152" data-linked-resource-type="page" data-linked-resource-default-alias="Container Instantiation" data-base-url="http://docs.codehaus.org">container instance</a>.</p><p>Once you have this container instance, starting the container is as simple as calling the <code>start()</code> method. Before doing this though you'll need to ensure you have defined the container's <code>home</code> (if you're using a container in <a class="confluence-link unresolved" data-content-title="Standalone mode" data-linked-resource-default-alias="Standalone mode" href="#">standalone mode</a> - It's not required for containers in <a class="confluence-link unresolved" data-content-title="Embedded mode" data-linked-resource-default-alias="Embedded mode" href="#">embedded mode</a>).</p><p>Of course it you wish to statically deploy archives, you'll need to add <a class="confluence-link" href="/display/CARGO/Deployable" data-linked-resource-id="13115" data-linked-resource-type="page" data-linked-resource-default-alias="Deployable" data-base-url="http://docs.codehaus.org">deployables</a> to the container.</p><p>It is important to note that the <code>LocalContainer.start()</code> method will wait until the container is <strong>fully started</strong> before returning.</p><h3>Example using the Java API</h3><p>Starting Resin 3.x with no deployable:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/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>InstalledLocalContainer container = new Resin3xInstalledLocalContainer( new Resin3xStandaloneLocalConfiguration("target/resin3x")); container.setHome("c:/apps/resin-3.0.15"); container.start(); </pre></td></tr></table><h3>Example using the Ant API</h3><p>Before being able to use the Cargo Ant tasks you need to register them against Ant. This is done by using the Ant <code><taskdef></code> element. See the <a class="confluence-link" href="/display/CARGO/Ant+support" data-linked-resource-id="13120" data-linked-resource-type="page" data-linked-resource-default-alias="Ant support" data-base-url="http://docs.codehaus.org">Ant support page</a>. The action to start the container is specified using the <code>action="start"</code> attribute as shown below.</p><p>Starting Resin 3.x with no deployable:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="xml" style="background-image: url(/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><cargo containerId="resin3x" home="c:/apps/resin-3.0.15" action="start"/> </pre></td></tr></table><h3>Example using the Maven2/Maven3 plugin</h3><p>For the Maven2/Maven plugin, please read: <a class="confluence-link" href="/display/CARGO/Starting+and+stopping+a+container" data-linked-resource-id="44100" data-linked-resource-type="page" data-linked-resource-default-alias="Starting and stopping a container" data-base-url="http://docs.codehaus.org">Starting and stopping a container</a>.</p><h3>Other tips</h3><h5>Letting the started container outlive CARGO's process</h5><p>By default, the container started by CARGO is linked to CARGO's process; which means that once the Java process that has started the container is finished (be it via Java API, ANT or the Maven2/Maven3 plugin) the started container will also be killed.</p><p>In some cases, mostly if you want to use CARGO as a "launcher script", you need the started container to "outlive" CARGO's process, i.e. that the started container keeps running even after CARGO itself has terminated. This can be achieved by simply setting the property <code>GeneralPropertySet.SPAWN_PROCESS</code> (or, in the ANT tasks or Maven2/Maven3 plugin, the <code>cargo.process.spawn</code> property) to <code>true</code>.</p><p>Note that this feature is only available for standalone containers (i.e., not for embeded containers).</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced