Skip to end of metadata
Go to start of metadata

I'm a long time Gentoo Linux (http://www.gentoo.org/) user, and i think that Maven could adpot some idea's from gentoo's portage (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1).

Gentoo has a concept of "ebuilds" (which can be compared to poms). An ebuild is an install script of sorts for installing a particular piece of software. An ebuild defines, among other things, what it's dependencies (other ebuilds) are. There are two types of dependencies: optional and required. A required depency is something that the software needs to be built or run, while an optional depency is the exact opposite... it is optional at compile and run time. Basically an optional depency is a feature that the piece of sotware supports that isn't necessary for it to function.

There is also something in gentoo called "USE flags". Use flags are a system scope set of parameters that determine how ebuilds are built... and which features are included or excluded. For instance, "alsa" is a USE flag. If your use flags have "alsa" in them then any application that supports Alsa (Advanced Linux Sound Architecture) as an optional dependency will be compiled with support for alsa. Likewise, if your USE flags contain "-alsa" then anything that has optional support for alsa will not be compiled with support for alsa. I should also mention that if a particular ebuild requires alsa... alsa will be built as well as it (because it requires alsa at compile/run time)... but it and anything else that requires it will be the only piece of software on the machine that has alsa support. I should also note that Gentoo has what is called "profiles". Profiles contain (among other things) a default set of USE flags for the general user, so in theory a Gentoo user doesn't have to modify their USE flags whatsoever.

My thinking is that Maven could adopt this. Poms could specify required and optional dependencies, and at a project level USE flags could be defined to filter what gets included in a project. For instance someone using the Spring Framework may not be using Hibernate... in their use flags "-hibernate" could be defined so that maven knows not to grab hibernate (and all of it's dependencies) just because they want to use the spring MVC framework.

here's the Jira issue: http://jira.codehaus.org/browse/MNG-935

  • No labels