Maven plugin to deploy bundles to Virgo [message #773806] |
Mon, 02 January 2012 10:39  |
Eclipse User |
|
|
|
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 #778245 is a reply to message #773806] |
Wed, 11 January 2012 17:18   |
Eclipse User |
|
|
|
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 #783431 is a reply to message #780607] |
Wed, 25 January 2012 12:47  |
Eclipse User |
|
|
|
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.04880 seconds