On Wed, Jan 21, 2015 at 10:07 AM, Prabath Abeysekera <[email protected]> wrote:
> This is one of the things that I too am trying to figure out. Maybe this > is a best practice, but is it really the right move to dump all the > dependencies that your sub-modules use, into the parent pom, without > focussing on whether they all are being used by each and every one of those > sub-modules? > > For example, in Manoj's use-case, there's a couple of dependencies only > used by the "mobile services" sub-module. There, I personally don't see any > reason why we need to keep them all configured in the dependencyManagement > section of the top-most parent pom of MDM repository. Further, if at some > point, you would want to remove the mobile service module and introduce > something different, there, the removal of the said module would leave the > parent pom with some stale dependencies which aren't used by any other > child module. Is this acceptable? > > Maybe, this is a minor problem and I'm over-analyzing the whole thing. > Just wanted to double check whether what Malaka mentioned is the proper way > of handling this. > This idea is not accurate, this is why Maven has introduced two concepts as <dependencyManagement> and <dependencies>. - <dependencyManagement> allows to consolidate and centralize the management of dependency versions without adding dependencies which are inherited by all children [1]. - <dependencies> declare the actual usage of a dependency and if the dependency is managed in a parent pom you can do so without using a version and it will be inherited and therefore be consisted across you usages downstream of the the parent pom. Basically, dependency management is PM task and we need a centralized place, we use parent POM for that. With the size of our code base it would be great if we can assume all dependency versions have defined in parent POM of the repository. Sometimes back we have very bad experiences where sub modules use incompatible dependencies and can't detect them until we start products packs or manual detection require great amount of time to investigate each and every POM file of the code repo. Declaring all dependency versions in a centralized place greatly improve maintainability and readability. [1] - http://stackoverflow.com/a/2619732/875165 Thanks ! > > Cheers, > Prabath > > On Wed, Jan 21, 2015 at 5:37 AM, Malaka Silva <[email protected]> wrote: > >> IMO best it to have it in the parent since it's easy to change. >> >> We are doing the same for ESB components. >> >> On Wed, Jan 21, 2015 at 2:37 AM, Manoj Gunawardena <[email protected]> >> wrote: >> >>> Hi, >>> According to MAVEN best practices, dependency management (versions) >>> should maintain in the parent POM. >>> In the CDM, we have following module structure. >>> CDM >>> - core >>> -common >>> >>> MDM >>> - mobileservices >>> -Agent >>> - android >>> -windows >>> -ios >>> Best way of manage agent level dependencies in MDM pom (parent pom) or >>> mobileservices POM? >>> Please share your thoughts, >>> >>> -- >>> Manoj Gunawardena >>> Tech Lead >>> WSO2, Inc.: http://wso2.com >>> lean.enterprise.middleware >>> Mobile : +94 77 2291643 >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> >> Best Regards, >> >> Malaka Silva >> Senior Tech Lead >> M: +94 777 219 791 >> Tel : 94 11 214 5345 >> Fax :94 11 2145300 >> Skype : malaka.sampath.silva >> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 >> Blog : http://mrmalakasilva.blogspot.com/ >> >> WSO2, Inc. >> lean . enterprise . middleware >> http://www.wso2.com/ >> http://www.wso2.com/about/team/malaka-silva/ >> <http://wso2.com/about/team/malaka-silva/> >> >> Save a tree -Conserve nature & Save the world for your future. Print this >> email only if it is absolutely necessary. >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Prabath Abeysekara > Associate Technical Lead, Data TG. > WSO2 Inc. > Email: [email protected] > Mobile: +94774171471 > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Sagara Gunathunga Senior Technical Lead; WSO2, Inc.; http://wso2.com V.P Apache Web Services; http://ws.apache.org/ Linkedin; http://www.linkedin.com/in/ssagara Blog ; http://ssagara.blogspot.com
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
