DefinitionThe configuration files are the files to add to your container's configuration. It is internally used by some containers and is accessible for you can to add extra files.
In some cases, it is necessary to enrich your container configuration with extra files. This can be done using Cargo's
configFiles option, accessible via the Cargo APIs.
The advantage of using this option is that it can replace configuration properties in your files: simply use, for example,
@cargo.servlet.port@ to have it replaced with the port on which the Servlet/JSP container is listening to.
You might for example want to add the advanced login configuration to your JBoss instance.
Example using the Java API
Example using the Maven 2 plugin
More advanced example: adding the jetty-env.xml file
To define a central
jetty-env.xml file and reuse it later from your WARs, you can proceed as follows:
As explained on the top of this page, use a standalone local container (i.e., not an embedded configuration)
Make sure the property
cargo.jetty.createContextXml) is set to
false; so that CARGO doesn't create a
context.xmlfile for your WAR's deployable but rather copies it from the source to the configuration home folder.
For each deployable, make sure the deployable is defined as an expanded WAR; as explained on the Static deployment of expanded WAR page.
Finally, for each deployable, add the following to your local container's configuration:
webapp-contextis the Web application's context
- To deploy your WAR, CARGO will copy your WAR's expanded version (i.e., the WAR directory) into the
webappssubdirectory of the Jetty configuration
- Once the WAR is copied, CARGO will also copy the
jetty-env.xmlfile into that WAR's WEB-INF directory
As a reference, please find below the full configuration for Jetty 7.x: