On Mar 15, 2007, at 6:19 PM, Cedric Hurst wrote:
I looked into plugins a few times before but I wasn't quite sure how they would work with Maven repositories directly. From my understanding, the repo must have a geronimo-plugins.xml file to work as a remote repositoryfor Geronimo.I guess I'm really just trying to gain access to the rich library of maven2libraries from within the geronimo common libs.Unfortunately, the Geronimo Plugins catalog seems relatively limited so far. I can't any of my required dependencies on geronimoplugins.com, whereas I can find them all on http://mirrors.ibiblio.org/pub/mirrors/ maven2/. I'd like to be able to say say "I need hibernate-3.2" in my deployment plan and have Geronimo go out to the Maven2 central repository and download hibernateand all its dependencies.
so, I didn't explain myself very well, all too common... hopefully I won't make things worse....
Geronimo is built up out of modules (formerly called configurations) which are more or less pre-deployed applications with dependency information in a form geronimo can understand. Geronimo plugins are modules with a little more metadata, but I'm not quite sure what it is, just that it makes it easier to move them around and install them from remote plugin repos.
So, I think you want to end up with your app as a geronimo module, or more likely a geronimo plugin. There are a couple ways to do that. I think the most satisfactory for you will probably be to use the geronimo car-maven-plugin to directly build the module/plugin using maven, and then it will be in your local maven repo. You can also deploy it to remote repos using mvn deploy (I think, I have't tried this). To turn it into a plugin you just include an xml file in the appropriate spot after figuring out what goes inside.
OK, now you have your module, and you need to get it into a geronimo server. This is the part where I'm not sure what functionality is currently available where. i think if its a plugin then the plugin installer will pull the dependencies you need, but I'm not exactly sure where they are specified or pulled from. You can also just install a car file but I don't think that pulls dependencies from anywhere -- the deployer does't know about maven repos. the maven assembly stuff definitely knows how to install a car file from your local repo into a geronimo repo, and pull all the dependencies transitively into the g. repo. However I don't know whether it can do this with an existing server -- the only places its used now are to build a whole new server.
I think what we need is a way to run the assembly functionality in the car plugin so it installs the car + dependencies into a specified geronimo server. I don't know if it can do this right now but all the basic functionality is there, at most we'd need to wire it up appropriately.
thanks david jencks
djencks wrote:On Mar 15, 2007, at 5:13 PM, CedricHurst wrote:I have another question regarding Geronimo and Maven2 interaction. In the lab we're building, we have quite a few dependencies (Spring, Hibernate, org.json, Derby Client). We're using Maven2 to define these dependencies within the project and inject them in the WAR file, but we're wondering if there's a better way. I've often stared at the common libs portlet in the admin console and wondered if there was a way to get that talking to our standalone maven repository. This would would allow us topull down the dependency trees through the maven command and have themavailable inside the Geronimo installation at-large (instead of manually adding 20+ libraries by hand from the admin console). That way, instead of specifying the dependencies in the pom.xml and deploying a 100MB+ war file,we could define the dependencies in the deployment plan and push muchsmaller files to the server, relying on common libs to supply the needed jars. Is this possible?Yes. That's kind of how we build the server. The car-maven-plugin uses the local maven repository as the geronimo repository and basically starts a server up using the maven repo, and runs some deploy command, and then copies the result(s) back into the local maven repo. Assembly looks at the recorded geronimo dependencies in each module/configuration we install and pulls its dependencies fromthe local maven repo into the repository of the server being assembled.There's also the plugin system which is pretty much like what the assembly stuff does except it can work with remote maven repos. It has an additional xml file describing more about the plugin, but I'm not exactly sure what. There are some problems relating the geronimo and maven concepts of repository, mostly about how to resolve versions, but I'm not sure they are insurmountable, just very annoying when you run into them. So, I'm not really clear on what you are trying to do, but I think if you study these a bit you can figure out a way to have a slim war with no external jars in it and use a collection of maven and geronimo repositories to load all the classes. One thing the car plugin does for you if you use it to "predeploy" your app is copy the maven dependencies from the pom.xml into your geronimo plan: that's why the plans in our configs dir don't have an environment element in them. This is slightly problematical due to the different meanings of "scope" in maven and geronimo and we might adopt a different system soon but might still be worth looking at. I think I'd recommend you go for a plugin. Hope this helps, perhaps I'll understand better exactly what you want to do with your next reply. thanks david jencks-- View this message in context: http://www.nabble.com/reconciling- geronimo-common-libs-and-standalone-maven2-repository- tf3411000s134.html#a9503712 Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.--View this message in context: http://www.nabble.com/reconciling- geronimo-common-libs-and-standalone-maven2-repository- tf3411000s134.html#a9504814 Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.