Community
Participate
Working Groups
Plans are a really nice way to deploy applications in Virgo. You can reference config files, bundles, etc. A PAR on the other hand contains everything, that makes up your application. In my eyes, the ideal deployment package would be a hybrid deployment type (in the following called PLAR). A PLAR would be a zip archive similar to a PAR, in that it has a MANIFEST.MF, may contain bundles, config files or other deployment units. Additionally, it would allow to specify additional, external dependencies with a included PLAN file. Therefore I could create an application with its main bundle(s), include the configuration and reference dependencies in Virgos bundle repository. The main advantage is a small deployment unit including configuration contained in a single file with external dependencies provided by Virgo. Example Layout: Archive xxx.plar META-INF/MANIFEST.MF (like in PAR) <Application-SymbolicName>.plan (references to external deps, config) org.example.core-1.0.0.jar (main app) org.example.web-1.0.0.jar (web interface) app-config.properties (configuration, e.g. database) Maybe this could be implemented as an extension to the PAR deployer, which looks for a file <Application-SymbolicName>.plan in the PAR, and processes it similar to the PLAN deployer.
Interesting and shouldn't be too hard to implement as described: making a plan a valid artifact inside a PAR. Implementation notes: 1. There are some restrictions in ParPlanInstallArtifact which limit the contents of PARs to be bundles and configurations. The first step in implementing this would be to allow plans too. 2. PlanResolver converts a single node containing just a plan into a tree of install artifacts consisting of the single input node as the root and the plan contents as its children. This would need tweaking to ensure it doesn't skip partially resolved plans (i.e. PAR trees with unresolved plan subtrees). 3. After that, it should pretty much work, although bugs could clearly come out of the woodwork as this is a new use case. So suitable integration test should be written and then tested/debugged.
Implemented. See ParDeploymentTests.deployParContainingPlan which deploys org.eclipse.virgo.kernel.deployer.test/src/test/resources/plan-in-par/ParContainingPlan.par. Note that this implementation does not relax the restriction that scopes cannot be nested. Since a PAR is always scoped, a PAR containing a scoped plan will fail to deploy. Similarly if a scoped plan is indirectly referred to by a plan in a PAR, the PAR will fail to deploy. Any artifacts referenced by a plan inside a PAR must reside in the repository as usual. In particular, a plan inside a PAR may not refer to artifacts supplied in the PAR. If there is a good use case for this, then a separate enhancement bug should be raised.
Great, thanks, Glyn! Are there any upcoming builds (milestones, ...), were I can check it out without building the whole thing myself?
Hi Wolfgang If you are happy to try a kernel build, take one from Hudson e.g. [1]. Otherwise wait for milestone 4 which should ship in about 3-4 weeks. [1] https://hudson.eclipse.org/hudson/view/Virgo/job/virgo.kernel.snapshot/lastSuccessfulBuild/artifact/build-kernel/target/artifacts/virgo-kernel-3.0.0.CI-2011-03-21_20-52-50.zip