4.2. Deploying A Web Application
/opt/my-application/deploy
/opt/my-application/deploy
myApp1.war to the deploy/ directory.
/opt/my-application/deploy/myapp1.war/
/opt/my-application/deploy/myapp1.war/
In this case, the bundle file contains only the WAR file itself and the deploy.xml recipe.
Unlike the application server, when deploying the web app, there are or could be other web apps also in the deploy/ directory. The bundle system, then, should not manage the root directory, meaning existing or new files should be allowed within the root directory even if they are not included in the bundle.
manageRootDir=false, which tells the provisioning system to leave alone any existing files in the directory that are outside the bundle.
Note
manageRootDir=false only preserves files outside the bundle deployment. If the bundle directory is deploy/myApp/, then any files in deploy/myApp/ or subdirectories like deploy/myApp/WEB-INF/ will be overwritten or removed when the bundle is deployed. The subdirectories defined in the bundle distribution are still entirely managed by the bundle system.
- Include all of the web applications in the same bundle distribution. For example, to deploy
myApp1.warandmyApp2.warto thedeploy/directory, both WAR files can be included in the same bundle and deployed todeploy/myApp1.war/anddeploy/myApp2.war/simultaneously. - It may not be possible to roll all of the web apps into the same bundle. Instead of using
deploy/as the root directory, there could be two different bundle distributions that use a subdirectory as the root directory. For example, the first web app could usedeploy/myApp1/so that the final deployment isdeploy/myApp1/myApp1.war/, while the second app usesdeploy/myApp2/, resulting indeploy/myApp2/myApp2.war/.This allows the two web applications to be deployed, updated, and reverted independently of each other.