This is a little something that’s now caught me out a few times. Quite often, I’ll have a project with a parent POM, and a module that I only care about in certain circumstances. So I naturally do this.
foo-core foo-webapp dist foo-dist
Unfortunately, this can interact badly with the release plugin. Unless that profile is activated during release, the module won’t have it’s version updated. So the next time you use that profile, it’ll break.
The correct solution is to “push down” the profile into the
foo-dist module. i.e.
foo foo-parent 1.0-SNAPSHOT foo-core foo-webapp foo-dist foo-dist foo foo-parent 1.0-SNAPSHOT dist
foo-dist is always available, but is a noop unless the profile is activated. But it does ensure that the release plugin (and also the versions plugin) know that it’s there.