Forcing child projects, when tightly linked, to duplicate the version of the parent is a design bug in Maven. Use of the versions plugins to automatically update it is just a workaround hack.
And anyway, "mvn versions:set -D..." run in an aggregator pom only updates the aggregator, not the children. Another bug then... Oh, and I don't trust maven to update my scm. So no thanks to the release plugin. Oh well... Stephen On 30 May 2013 16:53, Curtis Rueden <[email protected]> wrote: > Hi Stephen, > >> Both the aggregator and parent specify the version number. All the >> children use ${project.version} for inter-project dependencies. > > This is how my team structures our projects as well. > >> But, the children are forced by the pom to refer to the parent by an >> explicit version number, resulting in the version number being >> everywhere. > > Indeed, as far as I know, you have to explicitly include the version in the > <parent> block of every child module. However, you can use "mvn > versions:set" to easily update it for the entire multi-module project. > > Regards, > Curtis > > > On Thu, May 30, 2013 at 10:45 AM, Stephen Colebourne > <[email protected]>wrote: > >> I have a multi-module build where all the projects are to be released >> as one with the same version number. I'm looking for the best practice >> to handle this. >> >> Currently, as per >> https://github.com/OpenGamma/OG-Platform/tree/topic/maven, I have this >> setup: >> >> aggregator pom (in root) >> parent pom >> pom in each jar-producing child >> >> Both the aggregator and parent specify the version number. All the >> children use ${project.version} for inter-project dependencies. But, >> the children are forced by the pom to refer to the parent by an >> explicit version number, resulting in the version number being >> everywhere. >> >> >> My preferred solution is to remove the version from the child and rely >> totally on the relativePath. While this would mean that the project >> could not be built without its parent being in place, that seems >> entirely reasonable in this scenario. But this would no doubt need a >> new mvn major version. >> >> mvn versions:update-child-modules does not work to help update >> versions as the aggregator is separate from the parent. >> >> >> Am I missing something, or does maven really force the version number >> to be everywhere. >> thanks >> Stephen >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
