|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DocumentationContainers
Get InvolvedFeeds
|
DefinitionProperties to configure a container (request port, shutdown port, logging level, threads, etc)ExplanationsIt is possible to set container configuration properties using the Cargo API. These properties are applied to a Configuration. There are 2 kinds of properties:
Some general properties:
Support Matrix
Java APIExample of starting Tomcat 5.x on port 8081: Configuration configuration =
new Tomcat5xStandaloneLocalConfiguration("target/tomcat5x"));
configuration.setProperty(ServletPropertySet.PORT, "8081");
[...]
You can check if a configuration supports a given property by using For example if you want to check if the configuration supports setting the port property: boolean isPropertySupported = configuration.getCapability().supportsProperty(ServletPropertySet.PORT); Ant TaskExample of starting Tomcat 5.x on port 8081: <cargo containerId="tomcat5x" home="c:/apps/jakarta-tomcat-5.0.29" action="start">
<configuration>
<property name="cargo.servlet.port" value="8081"/>
</configuration>
</cargo>
Maven 2 PluginExample of starting Tomcat 5.x on port 8081: <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>
Using Java propertiesAll configuration properties (be it with the Java API, ANT tasks or Maven2/Maven3 goals) can also be overriden using Java properties. For example, with Maven: mvn -Dcargo.servlet.port=8082 cargo:start |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||