| Maven plugin to deploy bundles to Virgo [message #773806] |
Mon, 02 January 2012 10:39  |
|
Hi guys
During the holidays I spent some time to develop a small Maven plugin that is able to deploy/undeploy/refresh bundles via specific goals. It uses the Deployer MBean from Virgo. Maybe it's of some use to somebody.
The sourcecode can be found on Github. Unfortunately the plugin is not available in any Maven repository yet so one has to download the source and build it first.
I tested it with VTS 3.0.2/3.5M1 and Maven 3.0.3 even though I didn't do a lot of testing. If anyone hits a bug or has any suggestions please let me know.
Frieder
|
|
|
|
|
| Re: Maven plugin to deploy bundles to Virgo [message #774576 is a reply to message #774465] |
Wed, 04 January 2012 03:02   |
Glyn Normington Messages: 1186 Registered: July 2009 |
Senior Member |
|
|
Thanks Frieder. Nice work! If you decide at some point that there would be an advantage in contributing this project to Virgo, I would certainly be open to discussing that. The immediate benefits I can think of are uniformity of (a) license, (b) source code management, (c) documentation, (d) bug tracking, and (e) community feedback mechanisms such as this forum. If you prefer not, I quite understand.
For the benefit of others, the wiki section is here.
[Updated on: Wed, 04 January 2012 03:03] Report message to a moderator
|
|
|
|
| Re: Maven plugin to deploy bundles to Virgo [message #778245 is a reply to message #773806] |
Wed, 11 January 2012 17:18   |
Rafal Krzewski Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Thanks for sharing your work, Frieder!
I was wondering if you know about Cargo (cargo.codehaus.org). I believe that the code you've written could be integrated into Cargo to add support for Virgo as a J2EE container.
Cargo is quite popular and it supports OSGi bundle deployment support alongside with "traditional" J2EE artifacts, so this seems to be a natural match.
Deploying bundles is great, but I think it's also important to provide a mechanism for deploying other Virgo artifacts: plans and PARs. A first step towards that would be making them first class Maven artifacts by defining new packaging types. Unfortunately "par" is already taken (EJB 3.0 persistence archive) - "virgo-par" could serve as an alternative. For plans, "virgo-plan" could be used for symmetry. File name extensions of the actual artifacts could be .par and .xml respectively, it's just the packaging type that needs to be distinct to avoid clashing with other tools.
Supporting plans is rather trivial - there's nothing to do except in install and deploy lifecycle phases. PAR support is a bit more involved - constituent bundles should artifacts need to collected through Maven dependencies, .properties files should be added from src/main/resources (or src/main/configuration) and possibly a plan could be generated - PARs can contain a nested plan to determine startup ordering, if my memory serves me. Plan generation should be optional, and the required configuration should be minimal - usually there's only a few bundles for which the order matters, so it would be convenient to spell out only those and have the rest added after them automatically.
Cargo supports container type specific deployable types, so the PARs and plans could be deployed in an uniform way.
That's exciting stuff. I wish I had time to sit down and work on it myself
Regards,
Rafał
|
|
|
| Re: Maven plugin to deploy bundles to Virgo [message #778966 is a reply to message #778245] |
Sat, 14 January 2012 03:45   |
|
Hi Rafal
I think it's an interesting idea to support plans/pars as well. As soon as I have some leisure time I'll check whether or not there is MBean support for these artefact types and in case there is support for it I'll start working on this.
I didn't know about Cargo until now. I had a quick look and it seems to be an interesting project but I have to read a little more about it. I talked to Glyn this week and I'm going to contribute the project to Virgo. For the moment that's my priority. Once this has been done I can also take a look on the Cargo integration but no promises on this.
Wish all of you a nice weekend.
Bye
Frieder
[Updated on: Sun, 15 January 2012 04:07] Report message to a moderator
|
|
|
|
|
| Re: Maven plugin to deploy bundles to Virgo [message #780550 is a reply to message #780522] |
Wed, 18 January 2012 10:14   |
|
Hi Rafal
I think we should be careful not doing the work twice as I'm also working on the plugin. Moreover Glyn told me to wait for the 2nd milestone beause this will probably require some refactoring of parts of the code.
I think we should discuss the work items and coordinate who is working on what part of the project. In case that you have Skype (friederheugel) or ICQ (63395941) please contact me.
Bye
Frieder
|
|
|
|
| Re: Maven plugin to deploy bundles to Virgo [message #783431 is a reply to message #780607] |
Wed, 25 January 2012 12:47  |
|
Hi guys
I was thinking about Rafals suggestion regarding the par/plan support and following are my thoughts (sorry for the late response).
1.) I agree with Rafal that the maven-virgo-plugin should support the deployment of plan/par files but I don't think that the plugin should be responsible for building this kind of artifact. Otherwise there would be bundlor to create bundles and this plugin to create pars and plans.
2.) There already exists a maven plugin for creating par files that has been contributed to SpringSource back in 2009, see http://blog.springsource.org/2009/06/24/maven-par-plugin-100m1/. I couldn't find the creator's email address but maybe someone of the SpringSource team has it so it might be worth asking him/her to contribute that under the EPL to Virgo so we could improve this plugin instead of developing a new one.
3.) I'm not sure if plan/par support should be standalone or part of bundlor.
4.) I'm not sure what Rafal means with m2e integration as the Maven plugin already works just fine with m2e.
5.) Currently I don't know how we could integrate the Maven tooling to Virgo IDE. The only thing that came to my mind was to create a new Maven archetype that is creating a Maven project which at the same time is a VirgoIDE-enabled Eclipse project (pretty much like the current SpringSource OSGi archetype but with additional entries in the project files for the VirgoIDE nature).
What are your thoughts on this?
@Glyn
I already did some changes regarding the new directory layout to the current source (didn't check it in though) but I'd like to wait if anyone has some ideas regarding the above mentioned points as this might influence the plugin. I hope that's fine for you.
I have one more question. As the naming of the configuration folder has changed and the plugin is depending on the directory structure I'm wondering if I should either implement that the plugin is first checking for a configuration/ folder and then for a config/ folder or if people would prefer to have a configuration item (e.g. <legacy>true</legacy>) in the pom file.
Bye
Frieder
|
|
|
Powered by
FUDForum. Page generated in 0.04822 seconds