Questions on multi-module management
Dear Users and Developers, I'm using maven for a multi module project, my current layout is: / /module-a /module-b /ejb /ear /web-a /web-b /tools-a /tools-b The module-a / module-b is common module shared by other ejb/web/tools module. And module-b is depends on module-a. Building all modules at once (web, ejb, tools) is too time consuming (too long to complete the compile/test/package). And my question is: if I modified sources in both module-a/module-b how can I conveniently build ONLY the module-a and module-b? I currently have two approaches but neither one is good enough IMO, I describe it here and asking for comments/ advice. Approach I: As module-b depends on module-a, I can do this: (cd module-a mvn install) (cd module-b mvn compile) If I don't install module-a, module-b will not build (the dependency). This approach is not really good, as it involves so much command to issue, also, the dependency management in Maven is completely not used. Approach II: My another solution is using a tricks with profile. I declare the the parent pom with en empty modules list: modules /modules If profile X is activated, module-a /module-b is added in the modules list. With this particular profile, maven will only build module-a and module-b. I have come-up with this approach for a long time, however, I need to define quite a lots of profile for various combination of module set. As a result, I think this approach is rather hackish... After all, what maven promotes is better and consistent build management, so I wonder if there is some better alternatives for this situation? Sorry for this long mail, it is just hard to express my problem. Thanks in advance!! Zarick Lau - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions on multi-module management
Zarick Lau [EMAIL PROTECTED] writes: Approach II: My another solution is using a tricks with profile. I declare the the parent pom with en empty modules list: modules /modules If profile X is activated, module-a /module-b is added in the modules list. With this particular profile, maven will only build module-a and module-b. I have come-up with this approach for a long time, however, I need to define quite a lots of profile for various combination of module set. As a result, I think this approach is rather hackish... Hello, I too used this approach to build different set of modules: test, integration, production. It works well and is, I think, rather more mavenish than the first solution. Do you have so many different combinations ? You could use multiple profiles to merge recurring subsets. Regards, -- OQube software engineering \ génie logiciel Arnaud Bailly, Dr. \web http://www.oqube.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Questions on multi-module management
On 8/9/07, Insitu [EMAIL PROTECTED] wrote: Zarick Lau [EMAIL PROTECTED] writes: Approach II: My another solution is using a tricks with profile. I declare the the parent pom with en empty modules list: modules /modules If profile X is activated, module-a /module-b is added in the modules list. With this particular profile, maven will only build module-a and module-b. I have come-up with this approach for a long time, however, I need to define quite a lots of profile for various combination of module set. As a result, I think this approach is rather hackish... Hello, I too used this approach to build different set of modules: test, integration, production. It works well and is, I think, rather more mavenish than the first solution. Do you have so many different combinations ? You could use multiple profiles to merge recurring subsets. I agreed that, the second approach is more 'mavenish', but just wonder if I have missed some other good convention / practice to handle this requirement. Thanks! Regards, Zarick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]