No, not a zip. I just need the bundles to be in the file system so that when the server packaging starts, they get packaged.
The job of the integrator is just to download the artifacts from nexus and leave them in the filesystem of the server's image. The fact that i want to use the info in the poms to minimize maintenance of the integration list is kind of orthogonal, i could do everything just with wget, but i would need a list of every single bundle to download. Maybe a bit of description of how building the server work will make it clearer. We download all the bundles from nexus (this is the part I do with maven), compile kernel drivers unrelated to the bundles, prepare OS configuration scripts, etc etc and then the whole system is packaged into an image that gets deployed to the client. This packaging into an image has nothing to do with maven, only the artifact download is done by maven at the server creation job (and not even for all the artifacts, just for OSGi bundle artifacts) And yes, you're right that for non-osgi artifacts this wouldn't work due to the classloader, so I definitely understand the default behaviour of maven, but this is in an OSGi context. Is there any way to bypass this core behaviour? a system property, flag?? it is very convenient to do integrations with maven due to the rich info in the poms. But obviously, the pom data could be used outside of maven so maybe what I'm missing is a different tool altogether. Another option would be a maven-plugin that creates its own dependency graph and doesn't rely on the one provided by maven core, which supports only a single version of a given artifact (at least that's what it looks like) Alejandro Endo | Software Designer/Concepteur de logiciels From: Ron Wheeler <[email protected]> To: [email protected], Date: 2014-11-25 03:07 PM Subject: Re: Maven use for integration It is still a bit unclear about what you will end up with if your idea works. Are you just hoping to get a zip file of OSGi artifacts that you can unzip to deploy? Multiple versions of non-OSGi artifacts will not work since the classloader will only load the first version that it finds. On 25/11/2014 1:45 PM, [email protected] wrote: > Hi Ron, > #1. I don't understand your question. You mean the poms of the artifacts > deployed in nexus? they each have their own pom and instructions on how to > build itself, just like a regular maven artifact > So I have an artifact A that gets deployed to nexus with groupId foo.bar > and artifactId A and version 1.0 and then six months later A gets updated > to version 2.0 > All this has nothing to do with integration > > Now the integration job will say, bring all the artifacts and their > dependencies to be able to run. One of them will be A 1.0. > Once a 2.0 is released, i don't want to integrate ONLY 2.0. I want to > integrate 1.0 and 2.0. So in my integration pom i have two dependencies, > one foo.bar:A:1.0 and another dependency foo.bar:A:2.0. This is were maven > core complains and ends up resolving one over the other, hence when i do a > copy-dependencies it only ends up integrating one of them So the 2 versions of A are on a list that you manually maintain in an integration file. Could you not keep that outside a pom and just get each version from the repo and use the pom of foo.bar:A:1.0 and foo.bar:A:2.0 to get their respective dependencies to build a list of the other artifacts. As long as you are talking about OSGi, you are OK. > > #2. Yes, I am. The problem is that via the nexus API there's no way to > have a list of ONLY entry points where i can say explicitly in a list > (that i'm trying to keep as small as possible) integrate A and that would > imply B and C if A depends on B and C. When I do it with maven, in my > integration pom I only declare a dependency on A and the dependency plugin > will copy transitive dependencies. This allows me to keep the manually > maintained list as small as possible and never forgetting to update it > when i introduce new dependencies since those new dependencies will be > pulled by the dependency plugin just because the POM already contains the > relationship information So once you have resolved the dependencies, you can get the Artifacts and repeat the resolution using these new dependencies eliminating duplicates if you find any. > I hope everything is clearer now, let me know You can use the Maven code to build the dependency resolution but you will have to glue this together with some top level code that reads your list of "seed" artifacts including the multiple versions of the ones that you care about and probably something to eliminate duplicate transitive dependencies and resolve version conflicts for non-OSGi artifacts if these are part of your requirement. It is hard to see how Maven alone is going to be happy building Artifacts that contain multiple versions of jar files without some help to let it know when it is OK and when it will lead to grief. > Thanks for replying > > > Alejandro Endo | Software Designer/Concepteur de logiciels > > > > > From: Ron Wheeler <[email protected]> > To: [email protected], > Date: 2014-11-25 01:33 PM > Subject: Re: Maven use for integration > > > > Since you are not getting any responses, let me ask some questions to > get some more details on the table. > > 1) Where is the definitive single source of dependency info that you use > to create the GAV ids for Nexus? How can a single pom reference 2 > versions of an artifact? > > 2) Are you aware of the API for Nexus? Can you use this to get the > artifacts once you have the list of artifacts? > > Perhaps these answers will stimulate some ideas. > Ron > > On 25/11/2014 10:55 AM, [email protected] wrote: >> Hello everyone, >> >> I wanted to ask what you guys though about using maven as an integration >> tool. Is it out of the scope of maven? is anyone else doing this? What I >> mean by integration is that the artifacts are built (also by maven but > in >> other jobs) and deployed to nexus, but I still need to download them all >> to a server for deployment. >> The build of this server invokes maven and I hooked to it via a pom that >> points to some artifacts that serve as an entry point to the dependency >> graph and then use the dependency:copy-dependencies goal. The point of >> this was to leverage the dependency information available in poms so I >> didn't have to keep a list of ALL the artifacts needed (osgi bundles > BTW), >> just of an entry point for maven to crawl the graph and pull everything. >> The problem I'm encountering that tells me maybe Maven is not meant for >> this is that I need to pull two artifacts where only the version is >> different (since in OSGi both can coexist just fine) but maven chooses >> only one and the other one doesn't get integrated. So, are there ways to >> force maven to not drop the second version when resolving its model or > am >> I just stretching what maven can do? if so, are there any other tools > that >> leverage pom information to download artifacts from a maven repo? i > don't >> want to have to maintain that dependency information in two different >> places >> >> Thank you, >> >> Alejandro Endo | Software Designer/Concepteur de logiciels >> >> DISCLAIMER: >> Privileged and/or Confidential information may be contained in this >> message. If you are not the addressee of this message, you may not >> copy, use or deliver this message to anyone. In such event, you >> should destroy the message and kindly notify the sender by reply >> e-mail. It is understood that opinions or conclusions that do not >> relate to the official business of the company are neither given >> nor endorsed by the company. >> Thank You. >> > -- Ron Wheeler President Artifact Software Inc email: [email protected] skype: ronaldmwheeler phone: 866-970-2435, ext 102 --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] DISCLAIMER: Privileged and/or Confidential information may be contained in this message. If you are not the addressee of this message, you may not copy, use or deliver this message to anyone. In such event, you should destroy the message and kindly notify the sender by reply e-mail. It is understood that opinions or conclusions that do not relate to the official business of the company are neither given nor endorsed by the company. Thank You.
