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
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>Properties to configure a container (request port, shutdown port, logging level, threads, etc)</p></td></tr></table><h3>Explanations</h3><p>It is possible to set container configuration properties using the Cargo API. These properties are applied to a <a class="confluence-link" href="/display/CARGO/Configuration" data-linked-resource-id="13113" data-linked-resource-type="page" data-linked-resource-default-alias="Configuration" data-base-url="http://docs.codehaus.org">Configuration</a>.</p><p>There are 2 kinds of properties:</p><ul><li>General properties</li><li>Container-specific properties. See each <a class="confluence-link" href="/display/CARGO/Containers" data-linked-resource-id="13099" data-linked-resource-type="page" data-linked-resource-default-alias="Containers" data-base-url="http://docs.codehaus.org">container</a>'s page for a list of all the properties it supports.</li></ul><p>Some general properties:</p><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Property name</p></th><th class="confluenceTh"><p>Java constant (for the Java API)</p></th><th class="confluenceTh"><p>Description</p></th><th class="confluenceTh"><p>Valid values</p></th><th class="confluenceTh"><p>Default value</p></th><th class="confluenceTh"><p>Example</p></th></tr><tr><td class="confluenceTd"><pre>cargo.hostname</pre></td><td class="confluenceTd"><pre>GeneralPropertySet.HOSTNAME</pre></td><td class="confluenceTd"><p>Host name on which the container listens to</p></td><td class="confluenceTd"><p>string</p></td><td class="confluenceTd"><pre>localhost</pre></td><td class="confluenceTd"><pre>myserver</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.jvmargs</pre></td><td class="confluenceTd"><pre>GeneralPropertySet.JVMARGS</pre></td><td class="confluenceTd"><p>JVM args to be used when starting/stopping containers</p></td><td class="confluenceTd"><p>string</p></td><td class="confluenceTd"><pre>N/A</pre></td><td class="confluenceTd"><pre>-Xmx500m</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.logging</pre></td><td class="confluenceTd"><pre>GeneralPropertySet.LOGGING</pre></td><td class="confluenceTd"><p>Level representing the quantity of information we wish to log</p></td><td class="confluenceTd"><p><code>low</code>, <code>medium</code> or <code>high</code></p></td><td class="confluenceTd"><pre>medium</pre></td><td class="confluenceTd"><pre>high</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.protocol</pre></td><td class="confluenceTd"><pre>GeneralPropertySet.PROTOCOL</pre></td><td class="confluenceTd"><p>Protocol on which the container is listening to</p></td><td class="confluenceTd"><p><code>http</code> or <code>https</code></p></td><td class="confluenceTd"><pre>http</pre></td><td class="confluenceTd"><pre>http</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.remote.password</pre></td><td class="confluenceTd"><pre>RemotePropertySet.PASSWORD</pre></td><td class="confluenceTd"><p>Password to use to authenticate against a remote container (when deploying for example)</p></td><td class="confluenceTd"><p>string</p></td><td class="confluenceTd"><p>Depends on the container</p></td><td class="confluenceTd"><pre>manager</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.remote.username</pre></td><td class="confluenceTd"><pre>RemotePropertySet.USERNAME</pre></td><td class="confluenceTd"><p>Username to use to authenticate against a remote container (when deploying for example)</p></td><td class="confluenceTd"><p>string</p></td><td class="confluenceTd"><p>Depends on the container</p></td><td class="confluenceTd"><pre>system</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.rmi.port</pre></td><td class="confluenceTd"><pre>GeneralPropertySet.RMI_PORT</pre></td><td class="confluenceTd"><p>The port to use when communicating with this server, for example to start and stop it</p></td><td class="confluenceTd"><p>integer</p></td><td class="confluenceTd"><p>Depends on the container</p></td><td class="confluenceTd"><pre>1099</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.servlet.port</pre></td><td class="confluenceTd"><pre>ServletPropertySet.PORT</pre></td><td class="confluenceTd"><p>Port on which the Servlet/JSP container listens to</p></td><td class="confluenceTd"><p>integer</p></td><td class="confluenceTd"><pre>8080</pre></td><td class="confluenceTd"><pre>8280</pre></td></tr><tr><td class="confluenceTd"><pre>cargo.servlet.users</pre></td><td class="confluenceTd"><pre>ServletPropertySet.USERS</pre></td><td class="confluenceTd"><p>Allow defining users, passwords and map to roles. Note that having no roles at all for a user is allowed.</p></td><td class="confluenceTd"><p>string</p></td><td class="confluenceTd"><p>N/A</p></td><td class="confluenceTd"><pre>name1:pwd1:role11,...,role1N|name2:pwd2:role21,...,role2N|...</pre></td></tr></tbody></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Datasource and Resource configuration" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9RGF0YXNvdXJjZSBhbmQgUmVzb3VyY2UgY29uZmlndXJhdGlvbn0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>In addition to the "simple" properties presented here, some container also support properties for setting up datasources. You can read more on: <a class="confluence-link" href="/display/CARGO/DataSource+and+Resource+Support" data-linked-resource-id="116359224" data-linked-resource-type="page" data-linked-resource-default-alias="DataSource and Resource Support" data-base-url="http://docs.codehaus.org">DataSource and Resource Support</a>.</p></td></tr></table><h3>Support Matrix</h3><table class="confluenceTable"><tbody><tr><th class="confluenceTh"><p>Java</p></th><th class="confluenceTh"><p>Ant</p></th><th class="confluenceTh"><p>Maven2</p></th></tr><tr><td class="confluenceTd"><p><img class="emoticon emoticon-tick" data-emoticon-name="tick" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/check.png" alt="(tick)" title="(tick)" /></p></td><td class="confluenceTd"><p><img class="emoticon emoticon-tick" data-emoticon-name="tick" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/check.png" alt="(tick)" title="(tick)" /></p></td><td class="confluenceTd"><p><img class="emoticon emoticon-tick" data-emoticon-name="tick" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/check.png" alt="(tick)" title="(tick)" /></p></td></tr></tbody></table><h3>Java API</h3><p>Example of starting Tomcat 5.x on port 8081:</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>Configuration configuration = new Tomcat5xStandaloneLocalConfiguration("target/tomcat5x")); configuration.setProperty(ServletPropertySet.PORT, "8081"); [...] </pre></td></tr></table><p>You can check if a configuration supports a given property by using <code>Configuration.getCapability().supportsProperty(String propertyName)</code>.</p><p>For example if you want to check if the configuration supports setting the port property:</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>boolean isPropertySupported = configuration.getCapability().supportsProperty(ServletPropertySet.PORT); </pre></td></tr></table><h3>Ant Task</h3><p>Example of starting Tomcat 5.x on port 8081:</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="tomcat5x" home="c:/apps/jakarta-tomcat-5.0.29" action="start"> <configuration> <property name="cargo.servlet.port" value="8081"/> </configuration> </cargo> </pre></td></tr></table><h3>Maven 2 Plugin</h3><p>Example of starting Tomcat 5.x on port 8081:</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><build> <plugins> <plugin> <groupId>org.codehaus.cargo.maven2</groupId> <artifactId>cargo-maven2-plugin</artifactId> <configuration> <container> <containerId>tomcat5x</containerId> [...] </container> <configuration> <properties> <cargo.servlet.port>8081</cargo.servlet.port> </properties> </configuration> [...] </configuration> </plugin> </plugins> </build> </pre></td></tr></table><h3>Using Java properties</h3><p>All configuration properties (be it with the Java API, ANT tasks or Maven2/Maven3 goals) can also be overriden using Java properties.</p><p>For example, with Maven:</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>mvn -Dcargo.servlet.port=8082 cargo:start </pre></td></tr></table>
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