Hi,
I wonder if there is a way to specify properties for bundles in one plan (nested.plan) and attributes for that property in plan (outer.plan) that will import "nested.plan"?
nested.plan
outer.plan
From my testing it looks like attributes specified in the outer plan and not propagated into nested plan. If nested plan does not specify attribute for a placeholder value, generation of ArtifactDescriptor fails. If both nested.plan and outer.plan specify attribute value, the one in nested.plan is used.
I don't mind modifying dm-server code or decorating it in some way. Our deployment model is to use nested plans right now. Outer plan file is basically a "scope" aggregator of related "un-scoped" components to form an "application". Use of <attributes/> and <properties/> has a potential for providing an application configuration option that is not really available from config admin stand point - because (correct me here) config admin is not "scoped" to application. Another point of doing this is to be able to deploy multiple applications side by side (i.e. dev and qa) and specify context url for web-apps at the outer most level.
I wonder if there is a way to specify properties for bundles in one plan (nested.plan) and attributes for that property in plan (outer.plan) that will import "nested.plan"?
nested.plan
Code:
... <artifact type="bundle" name="webapp"> <property name="header:Web-ContextPath" value="${host.context.path}"/> </artifact> ...
Code:
<attributes> <attribute name="host.context.path" value="/host-outer"/> </attributes> <artifact type="bundle" name="core"/> <artifact type="bundle" name="application"/> <artifact type="plan" name="nested.plan"/>
Code:
Failed to read plan descriptor at com.springsource.kernel.artifact.plan.PlanBridge.generateArtifactDescriptor(PlanBridge.java:84) at com.springsource.repository.internal.LocalRepository.createArtifactDescriptor(LocalRepository.java:70) at com.springsource.repository.internal.watched.WatchedStorageRepository.access$2(WatchedStorageRepository.java:1) at com.springsource.repository.internal.watched.WatchedStorageRepository$DirectoryWatcher$1.onChange(WatchedStorageRepository.java:153) .... Caused by: java.lang.RuntimeException: Failed to read plan descriptor at com.springsource.kernel.artifact.plan.PlanReader.read(PlanReader.java:95) at com.springsource.kernel.artifact.plan.PlanBridge.generateArtifactDescriptor(PlanBridge.java:82) ... 58 common frames omitted Caused by: java.lang.RuntimeException: No value found for placeholder 'host.context.path' at com.springsource.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:122) at com.springsource.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:134) at com.springsource.util.common.PropertyPlaceholderResolver.resolveProperty(PropertyPlaceholderResolver.java:114) at com.springsource.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:107) at com.springsource.util.common.PropertyPlaceholderResolver.resolve(PropertyPlaceholderResolver.java:92) at com.springsource.kernel.artifact.plan.PlanReader.replacePlaceholders(PlanReader.java:170) at com.springsource.kernel.artifact.plan.PlanReader.parseArtifactProperties(PlanReader.java:163) at com.springsource.kernel.artifact.plan.PlanReader.parseArtifactElements(PlanReader.java:149) at com.springsource.kernel.artifact.plan.PlanReader.parsePlanElement(PlanReader.java:122) at com.springsource.kernel.artifact.plan.PlanReader.read(PlanReader.java:93) ... 59 common frames omitted
Comment