Hello. On 2017-03-05T01:18:34 +0100 Hervé BOUTEMY <herve.bout...@free.fr> wrote:
> first, you'll have to talk about rules, not only the plugin: there are many > rules, some implemented by the plugin and some implemented by MojoHaus extra- > enforcer-rules Right, yes. It's the requirePropertyDiverges rule in the extra-enforcer-rules package in this case. > > then: MojoHaus requirePropertyDiverges [1] requires that the property value > is > different, not that it is not empty > > IIUC what you're trying to do, you'll need both Maven requireProperty [2] and > MojoHaus requirePropertyDiverge [1] That seems wrong, somehow, and it doesn't match the behaviour that I posted. If I don't define a property, then the property (if any) will be inherited from an ancestor project, yes? The problem I'm having is that the requirePropertyDiverges rule seems to stop working after one level of inheritance. See these three example cases: 0. Project A defines a property P. Project B inherits from A and doesn't redefine or declare P. The requirePropertyDiverges rule correctly rejects this case and the build fails. https://github.com/io7m/requirePropertyDiverges-20170305/tree/master/case-0 ^^ Building this project should fail, and it does. 1. Project A defines a property P. Project B inherits from A and redefines P with a different value. The requirePropertyDiverges rule correctly accepts this case and the build succeeds. https://github.com/io7m/requirePropertyDiverges-20170305/tree/master/case-1 ^^ Building this project should succeed, and it does. 2. Project A defines a property P. Project B inherits from A and redefines P with a different value. Project C inherits from B and doesn't redefine or declare P. This case *should* fail, because in C, P is inherited from B and therefore has not diverged. https://github.com/io7m/requirePropertyDiverges-20170305/tree/master/case-2 ^^ Building this project should fail, but it doesn't. M
pgpM9RdH_mRmy.pgp
Description: OpenPGP digital signature