Hello Robert, thanks for coming up with this.
What about renaming "developers" to "requiredDeveloperRoles" and "contributors" to "requiredContributorRoles"? I still have the same problem as with the RequirePropertyDiverges rule: when the roles are defined in the company parent pom *for* the company parent pom, this rule will happily report the roles as existent :-(. Regards Mirko On Mon, Apr 9, 2012 at 23:25, Robert Scholte <[email protected]> wrote: > Hi Mirko > > When I was reading the xml for the first time I'd expected something else. > When looking at > > <requireRoles> > <developers>abc</developers> > <requireRoles> > > i would read it like: > who require roles? developers. > *which* developers? abc. > but what you are actually configuring are the *expected* roles. > > IMO the naming is not strong/self-explaining enough > suppose we want every developer with an @codehaus.org that they require a > role. > > I can imagne why orgamizations need such role, but please rethink the > naming. > > -Robert > ________________________________ > From: [email protected] > To: [email protected] > Date: Mon, 9 Apr 2012 15:14:25 -0500 > Subject: [mojo-scm] [16307] branches/mfriedenhagen/extra-enforcer-rules/src: > Documentation for new rule requireRoles. > > Revision 16307 Author mfriedenhagen Date 2012-04-09 15:14:25 -0500 (Mon, 09 > Apr 2012) > > Log Message > > Documentation for new rule requireRoles. > > Modified Paths > > branches/mfriedenhagen/extra-enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireRoles.java > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/index.apt > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requirePropertyDiverges.apt.vm > branches/mfriedenhagen/extra-enforcer-rules/src/site/site.xml > > Added Paths > > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requireRoles.apt.vm > > Diff > > Modified: > branches/mfriedenhagen/extra-enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireRoles.java > (16306 => 16307) > > --- > branches/mfriedenhagen/extra-enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireRoles.java > 2012-04-09 > 19:48:06 UTC (rev 16306) > +++ > branches/mfriedenhagen/extra-enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireRoles.java > 2012-04-09 > 20:14:25 UTC (rev 16307) > @@ -18,6 +18,7 @@ > * specific language governing permissions and limitations > * under the License. > */ > + > import java.util.Arrays; > import java.util.HashSet; > import java.util.List; > > Modified: branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/index.apt > (16306 => 16307) > > --- > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/index.apt > 2012-04-09 > 19:48:06 UTC (rev 16306) > +++ > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/index.apt > 2012-04-09 > 20:14:25 UTC (rev 16307) > @@ -38,6 +38,8 @@ > > * {{{./requirePropertyDiverges.html}requirePropertyDiverges}} - verifies > that a property in a child project diverges from one given in another > project. > > + * {{{./requireRoles.html}requireRoles}} - verifies that certain roles are > defined in a project. > + > [] > > * Usage > > Modified: > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requirePropertyDiverges.apt.vm > (16306 => 16307) > > --- > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requirePropertyDiverges.apt.vm > 2012-04-09 > 19:48:06 UTC (rev 16306) > +++ > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requirePropertyDiverges.apt.vm > 2012-04-09 > 20:14:25 UTC (rev 16307) > @@ -16,7 +16,7 @@ > ~~ under the License. > > ------ > - Requite Property Diverges > + Require Property Diverges > ------ > Mirko Friedenhagen > ------ > > Added: > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requireRoles.apt.vm > (0 => 16307) > > --- > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requireRoles.apt.vm > (rev 0) > +++ > branches/mfriedenhagen/extra-enforcer-rules/src/site/apt/requireRoles.apt.vm > 2012-04-09 > 20:14:25 UTC (rev 16307) > @@ -0,0 +1,92 @@ > +~~ Licensed to the Apache Software Foundation (ASF) under one > +~~ or more contributor license agreements. See the NOTICE file > +~~ distributed with this work for additional information > +~~ regarding copyright ownership. The ASF licenses this file > +~~ to you under the Apache License, Version 2.0 (the > +~~ "License"); you may not use this file except in compliance > +~~ with the License. You may obtain a copy of the License at > +~~ > +~~ http://www.apache.org/licenses/LICENSE-2.0 > +~~ > +~~ Unless required by applicable law or agreed to in writing, > +~~ software distributed under the License is distributed on an > +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY > +~~ KIND, either express or implied. See the License for the > +~~ specific language governing permissions and limitations > +~~ under the License. > + > + ------ > + Require Roles > + ------ > + Mirko Friedenhagen > + ------ > + April 2012 > + ------ > + > +Require Roles > + > + This rule checks that certain roles are defined in a project. > + > + Say you want to enforce a policy that every project defines specific > roles. > + > + The following parameters are supported by this rule: > + > + * <<<developers>>> - Comma separated list of developer roles which must > be defined. Defaults > + to no roles. > + > + * <<<contributors>>> - Comma separated list of contributor roles which > must be defined. Defaults > + to no roles. > + > + [] > + > + > + Sample Plugin Configuration: > + > ++---+ > +<project> > + <groupId>company</groupId> > + <artifactId>company-parent-pom</artifactId> > + <version>1.0</version> > + [...] > + <build> > + <plugins> > + <plugin> > + <groupId>org.apache.maven.plugins</groupId> > + <artifactId>maven-enforcer-plugin</artifactId> > + <version>${enforcerApiVersion}</version> <!-- find the latest > version at http://maven.apache.org/plugins/maven-enforcer-plugin/ --> > + <executions> > + <execution> > + <id>enforce-rquire-property-diverges</id> > + <goals> > + <goal>enforce</goal> > + </goals> > + <configuration> > + <rules> > + <requireRoles> > + <developers>project lead</developers> > + <contributors>business engineer, quality > manager</contributors> > + </requireRoles> > + </rules> > + <fail>true</fail> > + </configuration> > + </execution> > + </executions> > + <dependencies> > + <dependency> > + <groupId>${project.groupId}</groupId> > + <artifactId>${project.artifactId}</artifactId> > + <version>${project.version}</version> > + </dependency> > + </dependencies> > + </plugin> > + </plugins> > + </build> > + [...] > +</project> > ++---+ > + > + > + > +* Trademarks > + > + Apache, Apache Maven, Maven and the Apache feather logo are trademarks of > The Apache Software Foundation. > > Modified: branches/mfriedenhagen/extra-enforcer-rules/src/site/site.xml > (16306 => 16307) > > --- branches/mfriedenhagen/extra-enforcer-rules/src/site/site.xml > 2012-04-09 > 19:48:06 UTC (rev 16306) > +++ branches/mfriedenhagen/extra-enforcer-rules/src/site/site.xml > 2012-04-09 > 20:14:25 UTC (rev 16307) > @@ -26,7 +26,8 @@ > </menu> > <menu name="Rules"> > <item name="Ban Duplicate Classes" href="banDuplicateClasses.html"/> > - <item name="Requite Property Diverges" > href="requirePropertyDiverges.html"/> > + <item name="Require Property Diverges" > href="requirePropertyDiverges.html"/> > + <item name="Require Roles" href="requireRoles.html"/> > </menu> > </body> > </project> > > ________________________________ > To unsubscribe from this list please visit: > http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
