Hi,

For what it's worth, I agree that the requirePropertyDiverges rule is
difficult to use (and maybe buggy?). After playing with it some months ago,
I concluded that it was not going to work for me. That's why I ended up
writing my own rule.

If you want to ensure that the description is set in each child POM, maybe
the scijava-maven-plugin's requireElements rule _can_ help you here? Or do
you, again, only want to set the description in some intermediate POM layer?

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden


On Sun, Mar 5, 2017 at 3:31 AM, <org.apache.maven.u...@io7m.com> wrote:

> 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/tr
> ee/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/tr
> ee/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/tr
> ee/master/case-2
>
>    ^^ Building this project should fail, but it doesn't.
>
> M
>

Reply via email to