maven module build. Not specifying version with children modules -
we have multi-module build. have parent module builds 17 other modules , 1 of modules multi-module build builds 3 others.
in parent module:
<groupid>com.veggicorp.foobar</groupid> <artifactid>foobar-parent</artifactid> <version>5.4.3</version> <properties> <!-- definition of versions third party jars --> </properties> <dependencymanagement> <!-- way specify dependencies throughout project --> </dependencymanagement> <modules> <!-- list o' modules --> </modules>
by using properties specify versions (and using dependencymanagement), found can rid of sort of version numbering in child modules. makes simple maintain complex project since of changes take place in parent. when new version, don't have update 21 other pom.xml
files.
however, there 1 sore spot: have specify parent version:
<parent> <groupid>com.veggicorp.foobar</groupid> <artifactid>foobar-parent</artifactid> <version>5.4.3</version> <!-- must specify --> </parent> <artifactid>foo-server</artifactid> <!-- no need version --> <build> ....
note don't need specify version of child. takes parent's version default. however, have fill in parent's version number despite fact of sits in single git repository, , of modules unique project , not used anywhere else. won't deploying these modules' jars our maven repository. it's 1 big gigantic build.
i know can use version plugin update of these modules, means our developers must remember use plugin when create new version of project. (i don't have faith in our developers. heck, have directions on our wiki on how tie shoes.)
so, there way our child modules -- checkedout parent module in single big git repo -- can avoid having parent version number embedded in them?
the answer no, have include parent information in child modules , information has include version.
however once have set can use versions plugin mange versions of poms see http://www.mojohaus.org/versions-maven-plugin/
example, top level:
mvn versions:set -dnewversion=1.1
will change children , parent.
Comments
Post a Comment