Re: How to get the original pom which defines the rule configuration in a child?

2012-03-29 Thread Stephen Connolly
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
  propertyproject.url/property
  regexhttp://company/superpom/.*/regex
  definingGAcompany: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




Re: How to get the original pom which defines the rule configuration in a child?

2012-03-29 Thread Mirko Friedenhagen
Hello,

right now I retrieve the interpolated values, see
https://fisheye.codehaus.org/browse/~br=mfriedenhagen/mojo/branches/mfriedenhagen/extra-enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePropertyDiverges.java?r=16217#to98.

When the project parent pom PPP overrides the value defined in the
company super pom CSP it would be sufficient. Of course should the PPP
define it's own rule I want to enforce the children of the PPP must
override the property.

Regards Mirko


On Thu, Mar 29, 2012 at 09:13, Stephen Connolly
stephen.alan.conno...@gmail.com wrote:
 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
              propertyproject.url/property
              regexhttp://company/superpom/.*/regex
              definingGAcompany: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



-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org