Ticket #846 (closed Enhancement: fixed)
Plugin hot deployment
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.8 |
Component: | DeepaMehta Standard Distribution | Version: | 4.7 |
Keywords: | Cc: | dgf, Malte, JuergeN | |
Complexity: | 3 | Area: | Runtime Environment |
Module: | deepamehta-distribution |
Description
Plugin hot deployment is currently only supported in the development environment (when build from source) and in the Karaf Distribution, but not in the Standard Distribution.
The Standard Distribution should come with a "deploy" directory, which is empty be default. Bundles moved/removed to/from it should be deployed/undeployed automatically.
Change History
comment:4 follow-up: ↓ 5 Changed 9 years ago by Malte
Though i think of this generally as an imnprovement i feel a bit lost now. How can i continue to hot deploy via "mvn clean package", when a) having build dm4 from source and b) when not?
For a), is it the "modules-external" folder all my jars must be copied into?
For b), is it the "bundles-deploy" folder all my jars must be copied into?
I definitely will not relocate (and possibly copy) all my plugins source code into the (various) "bundle-deploy" folders of various dm4-distributions. So, what is to be adapted at the third party plugin developers maven side so ".jars" do not end up in an unwatched /target/ folder but in the resp. bundle folders (mentioned above)?
I guess we must either configure or additionally provide some kind of path to the folders (mentioned above), at best when doing something like "mvn clean package".
Thanks for your help & Cheers!
comment:5 in reply to: ↑ 4 Changed 9 years ago by jri
Replying to Malte:
How can i continue to hot deploy via "mvn clean package", when a) having build dm4 from source and b) when not?
For a), is it the "modules-external" folder all my jars must be copied into?
See https://trac.deepamehta.de/ticket/847#comment:8
So, yes, the standard case is to put your plugin source in "modules-external". In your plugin directory, when you perform "mvn clean package", the target jar is hot deployed automatically then (by being copied to "bundle-deploy", see https://trac.deepamehta.de/ticket/847#comment:4). No configuration is required.
At the moment in 4.8-SNAPSHOT there is only support for the standard case. When you want to keep your plugin source at another location additional configuration is required on your side. I'll add such a configuration option soon.
For b), is it the "bundles-deploy" folder all my jars must be copied into?
See https://trac.deepamehta.de/ticket/847#comment:3
So, the standard case is to put your plugin source in "bundle-dev". In your plugin directory, when you perform "mvn clean package", the target jar is hot deployed automatically then (by being copied to the distro's "bundle-deploy", see https://trac.deepamehta.de/ticket/846#comment:2). No configuration is required.
At the moment in 4.8-SNAPSHOT there is only support for the standard case. When you want to keep your plugin source at another location additional configuration is required on your side. I'll add such a configuration option soon.
Thanks for your question!
comment:6 follow-up: ↓ 8 Changed 9 years ago by jri
- Status changed from closed to reopened
- Resolution fixed deleted
A configuration option needs to be added in case the developer want keep hers plugin sources at a non-standard location (other than "bundle-dev" resp. "modules-external").
comment:7 Changed 9 years ago by Malte
Thank you, a configuration option for that would be really great (for my workflow)!
comment:8 in reply to: ↑ 6 Changed 9 years ago by jri
Replying to jri:
A configuration option needs to be added in case the developer want keep hers plugin sources at a non-standard location (other than "bundle-dev" resp. "modules-external").
The configuration option to come will work as follows: in your plugin's pom.xml you will configure the directory where your plugin gets hot deployed (once build with "mvn clean package").
comment:9 follow-up: ↓ 13 Changed 9 years ago by Malte
I would be glad if you could find a way to leave a platform run configuration (when building dm from source) in one of the platforms source config files.
If there is no way around i will surely get used to it but it doesn't sound good to me to spread the deploy paths into several configuration files of the plugins (e.g. eight in the kiezatlas setup).
comment:10 Changed 9 years ago by Malte
Please consider the following:
Normally, programmers (and thus plugin developers) will make errors, in this case, they may configure their plugin wrong (e.g. importModels-setting) or deploying a wrong version of a plugin.
How will the core/resp. the startup process/activation phase be visible in the log with this new approach? Both these "failure cases" are wonderfully covered by the current solution, e.g. the gogo shell allows to spot and possible restart and investigate a mis-configured bundle easily.
I just want to make sure here that there is no regression or unnecessary complication for the plugin developers workflow. I would be glad if the core developers will give this a try for themselves with one of their own 3rd party plugins to be able to assess the improvement properly.
Subsequently: What is the workflow around bundles incompatible with the current platform being started? would you expect that plugin devs clean this folder manually during each change in work projects?
Will compiled version of other 3rd party plugins (, plugins which are not part of the current project and thus not current to the dm4 platform version covering the modules-external|bundle-dev but there at the time of startup) stay in these new folders?
Thanks for your efforts on improving the plugin development workflow.
comment:11 follow-up: ↓ 12 Changed 9 years ago by Jörg Richter <jri@…>
comment:12 in reply to: ↑ 11 Changed 9 years ago by jri
Replying to Jörg Richter <jri@…>:
or relative (to the plugin pom.xml):
<properties> <dm4.deploy.dir>${project.basedir}/../../deepamehta/bundle-deploy</dm4.deploy.dir> </properties>
Sorry, this was misleading as actually an absolute path is specified.
You don't need ${project.basedir}/
Just write:
<properties> <dm4.deploy.dir>../../deepamehta/bundle-deploy</dm4.deploy.dir> </properties>
The path is relative to the plugin pom.xml
comment:13 in reply to: ↑ 9 ; follow-up: ↓ 16 Changed 9 years ago by jri
Replying to Malte:
I would be glad if you could find a way to leave a platform run configuration (when building dm from source) in one of the platforms source config files.
The config property felix.fileinstall.dir is still there (in global pom.xml). You still can add your own (target) directories there. DM will still scan all specified directories for deployable items. So, from my point of view your complex dev scenario is still supported.
And with DM 4.8-SNAPSHOT it even works if you don't build from source as the felix.fileinstall.dir config property exist in the binary distro's config.properties file as well.
2 things are to be considered tough:
- If you still want deploy your plugins via setting the felix.fileinstall.dir config property manually you possibly want disable the plugin from being copied automatically to the "bundle-deploy" directory once build (as DM 4.8-SNAPSHOT does). I have to provide such a disabling mechanism.
- Currently in DM 4.8-SNAPSHOT the config property felix.fileinstall.filter is dropped. It was used to watch only for jar files for deployment. Otherwise Felix File Install would try also to deploy the target's classes directory, which often fails. I have to check this out and possibly must re-add the felix.fileinstall.filter setting.
Thank you for presenting your dev scenario!
comment:14 Changed 9 years ago by Jörg Richter <jri@…>
comment:15 Changed 9 years ago by Jörg Richter <jri@…>
comment:16 in reply to: ↑ 13 Changed 9 years ago by jri
Replying to jri:
2 things are to be considered tough:
- If you still want deploy your plugins via setting the felix.fileinstall.dir config property manually you possibly want disable the plugin from being copied automatically to the "bundle-deploy" directory once build (as DM 4.8-SNAPSHOT does). I have to provide such a disabling mechanism.
This is done now.
See comment:14
- Currently in DM 4.8-SNAPSHOT the config property felix.fileinstall.filter is dropped. It was used to watch only for jar files for deployment. Otherwise Felix File Install would try also to deploy the target's classes directory, which often fails. I have to check this out and possibly must re-add the felix.fileinstall.filter setting.
I've checked that. We don't need the felix.fileinstall.filter property anymore.
The topic "revising the hot deployment mechanism" is considered complete now.
This state is supposed to be released as DM 4.7.1 (if no objection occur ;-)
comment:17 Changed 9 years ago by jri
- Status changed from reopened to closed
- Resolution set to fixed