Definition
Excerpt |
---|
How to pass system properties that will be available to the container while executing |
Explanations
It is sometime useful to pass system properties to the container that is executing. These properties are then available to the code executing in the container.
...
Starting Tomcat 3.x with some System properties set in the container JVM:
Code Block |
---|
InstalledLocalContainer container = new Tomcat3xInstalledLocalContainer(
new TomcatStandaloneLocalConfiguration("target/tomcat3x"));
container.setHome("c:/apps/jakarta-tomcat-3.3.2");
Map props = new HashMap();
props.put("mypropery", "myvalue");
container.setSystemProperties(props);
container.start();
|
...
Starting Tomcat 3.x with some System properties set in the container JVM:
Code Block | ||||
---|---|---|---|---|
| ||||
<cargo containerId="tomcat3x" home="c:/apps/jakarta-tomcat-3.3.2" action="start">
<sysproperty key="myproperty" value="myvalue"/>
</cargo>
|
Info | ||
---|---|---|
| ||
It is also possible to load the system properties from a file - simply use theĀ |
Example using the Maven2 plugin
Starting Tomcat 3.x with some System properties set in the container JVM:
Code Block | ||||
---|---|---|---|---|
| ||||
<container>
[...]
<systemProperties>
<myproperty>myvalue</myproperty>
</systemProperties>
</container>
|