So what you are trying to enforce is all of:
The property is defined in the current Pom
If the interplolated parent defines the property, the value defined in the
current Pom is not the same as the inherited value

Oh are you comparing the expanded or unexpanded value... Just in case the
inherited value contains project coords

On Wednesday, 28 March 2012, Mirko Friedenhagen <mfriedenha...@gmail.com>
wrote:
> Hello,
>
> I have written a extra enforcer rule (requitePropertyDiverges), which
> shall make sure, that properties are overwritten in a child pom. The
> usecase is as follows:
> - company super pom CSP
> - project parent poms PPP1, PPP2
> - project child poms PCP1A, PCP1B, PCP2A, PCP2B
>
> CSP
>  |-> PPP1
>      |-> PCP1A
>      |-> PCP1B
>  |-> PPP2
>      |-> PCP2A
>      |-> PCP2B
>
> Now CSP defines an URL in our inhouse wiki as well as a scm connection
> to our inhouse subversion repository. Developers using the CSP must
> e.g. override the URL as well as the scm.connection etc. The rule
> requireProperty allows to see that these properties are set, however
> as they are set in the CSP they just are "enhanced" by appending the
> artifactIds from their children. Right now I have to declare:
>          <rules>
>            <requirePropertyDiverges>
>              <property>project.url</property>
>              <regex>http://company/superpom/.*</regex>
>              <definingGA>company:superpom</definingGA>
>            </requirePropertyDiverges>
>          </rules>
>
> Using project.originalModel as suggested suggested on mojo-dev, I
> could get rid of regex by checking project.originalModel.url is not
> null.
>
> Now I want to get rid of definingGA as well, which would be the
> groupId resp. artifactId of the pom defining the rule but how to get
> the definingGA programmatically?
>
> Regards Mirko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>

Reply via email to