On Fri, Feb 13, 2009 at 10:23 AM, Richard Rodseth <[email protected]> wrote: > There's parent in the sense of a pom having a <parent> tag. > > <parent> > <groupId>info.flex-mojos</groupId> > <artifactId>flex-super-pom</artifactId> > <version>2.0.3</version> > </parent>
All settings, including profiles are inherited from the parent, but can be overriden. > And then there's the <modules> tag. > <modules> > <module>Lib1</module> > <module>Lib2</module> > <module>App</module> > </modules> These are the children. They should have a <parent> entry pointing back to this pom. > Presumably if I have a profile in the pom containing <modules>, its settings > will only apply if I build from that pom. In other words, if I want to be > able to build each artifact independently but still have project-wide > settings, I would need to have a custom parent pom, loaded into > Nexus/Artifactory. Not necessarily. All of the children poms (Lib1, Lib2, App) will inherit any profiles or settings you define in this pom. It is the parent pom to the children, though it also has it's own parent pom that it inherits from. The Lib1/Lib2/App poms inherit everything from this pom as well as the flex-super-pom. When you build a module, it looks for the parent pom, first it looks in the parent directory on the filesystem, if it finds it there it uses it. If it doesn't find it, then it looks in your repositories. If it can't find the parent anywhere, it won't build. Doing a mvn install puts all of your poms (and other artifacts) in your local repository (~/.m2/repository) Doing a mvn deploy puts all of your poms (and other artifacts) in your remote repository (Artifactory/Nexus/whatever). Once a pom is in a repository, any of it's children can be built without the parent being on the local filesystem, as it will download it from the repo. All parents/grandparents/... of the module you are building will be used to calculate the properties for the build. > I assume that's just a matter of using the repository gui > to upload a pom file (which could contain nothing more that a profile and a > <parent> as above) and giving it the type "pom". Am I on the right track? You could do that, but you already have a parent pom right here where you can put common settings. Here's how our build is laid out: root --apps (config/profiles here that applies to all apps) ----app1 ----app2 --components (config/profiles that applies to all components) ----common_components ------componentA ------componentB ----data_components (config/profiles that apply to our components that rely on our data model) ------componentC ------componentD --model (config/profiles that apply to our data model and services) ----data_model ----service1 ----service2 apps, components, common_component, data_components, model are all of type "pom". they have common settings for their respective children. app1, app2 are of type "swf" componentA..D and data_model, service1..2 are of type "swc" I can check out just componentC if I want and build it all by itself as long as data_components pom, components pom, and root pom are in a repository somewhere. It inherits settings from all 3 parent poms. Does that make more sense? Logan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos?hl=en?hl=en http://blog.flex-mojos.info/ -~----------~----~----~----~------~----~------~--~---
