geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1080093 - in /geronimo/genesis/trunk: ./ genesis-default-flava/ genesis-enforcer-rules/ genesis-enforcer-rules/src/ genesis-enforcer-rules/src/main/ genesis-enforcer-rules/src/main/java/ genesis-enforcer-rules/src/main/java/org/ genesis-en...
Date Thu, 10 Mar 2011 01:14:54 GMT
Author: djencks
Date: Thu Mar 10 01:14:53 2011
New Revision: 1080093

URL: http://svn.apache.org/viewvc?rev=1080093&view=rev
Log:
write some enforcer rules instead of our own enforcer

Added:
    geronimo/genesis/trunk/genesis-enforcer-rules/
    geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml   (with props)
    geronimo/genesis/trunk/genesis-enforcer-rules/src/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/
    geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
  (with props)
Modified:
    geronimo/genesis/trunk/genesis-default-flava/pom.xml
    geronimo/genesis/trunk/pom.xml

Modified: geronimo/genesis/trunk/genesis-default-flava/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/genesis-default-flava/pom.xml?rev=1080093&r1=1080092&r2=1080093&view=diff
==============================================================================
--- geronimo/genesis/trunk/genesis-default-flava/pom.xml (original)
+++ geronimo/genesis/trunk/genesis-default-flava/pom.xml Thu Mar 10 01:14:53 2011
@@ -207,17 +207,17 @@
         </pluginManagement>
 
         <plugins>
-            <plugin>
-                <groupId>org.apache.geronimo.genesis</groupId>
-                <artifactId>genesis-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>validate-configuration</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
+            <!--<plugin>-->
+                <!--<groupId>org.apache.geronimo.genesis</groupId>-->
+                <!--<artifactId>genesis-maven-plugin</artifactId>-->
+                <!--<executions>-->
+                    <!--<execution>-->
+                        <!--<goals>-->
+                            <!--<goal>validate-configuration</goal>-->
+                        <!--</goals>-->
+                    <!--</execution>-->
+                <!--</executions>-->
+            <!--</plugin>-->
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -242,30 +242,38 @@
                         <configuration>
                             <rules>
                                 <requireMavenVersion>
-                                    <version>[2.0.10,)</version>
+                                    <version>[2.2.1,)</version>
                                 </requireMavenVersion>
+                                <validateConfiguration implementation="org.apache.geronimo.genesis.enforcer.ValidateConfiguration"/>
                             </rules>
                         </configuration>
                     </execution>
                 </executions>
-            </plugin>
-
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-remote-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>process</goal>
-                        </goals>
-                        <configuration>
-                            <resourceBundles>
-                                <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
-                            </resourceBundles>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.geronimo.genesis</groupId>
+                        <artifactId>genesis-enforcer-rules</artifactId>
+                        <version>2.1-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+
+            <!--<plugin>-->
+                <!--<groupId>org.apache.maven.plugins</groupId>-->
+                <!--<artifactId>maven-remote-resources-plugin</artifactId>-->
+                <!--<executions>-->
+                    <!--<execution>-->
+                        <!--<goals>-->
+                            <!--<goal>process</goal>-->
+                        <!--</goals>-->
+                        <!--<configuration>-->
+                            <!--<resourceBundles>-->
+                                <!--<resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>-->
+                            <!--</resourceBundles>-->
+                        <!--</configuration>-->
+                    <!--</execution>-->
+                <!--</executions>-->
+            <!--</plugin>-->
 
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
@@ -388,29 +396,29 @@
     </reporting>
 
     <profiles>
-        <profile>
-            <id>apache-release</id>
-            <activation>
-                <property>
-                    <name>apache-release</name>
-                </property>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.geronimo.genesis</groupId>
-                        <artifactId>genesis-maven-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>validate-release-configuration</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
+        <!--<profile>-->
+            <!--<id>apache-release</id>-->
+            <!--<activation>-->
+                <!--<property>-->
+                    <!--<name>apache-release</name>-->
+                <!--</property>-->
+            <!--</activation>-->
+            <!--<build>-->
+                <!--<plugins>-->
+                    <!--<plugin>-->
+                        <!--<groupId>org.apache.geronimo.genesis</groupId>-->
+                        <!--<artifactId>genesis-maven-plugin</artifactId>-->
+                        <!--<executions>-->
+                            <!--<execution>-->
+                                <!--<goals>-->
+                                    <!--<goal>validate-release-configuration</goal>-->
+                                <!--</goals>-->
+                            <!--</execution>-->
+                        <!--</executions>-->
+                    <!--</plugin>-->
+                <!--</plugins>-->
+            <!--</build>-->
+        <!--</profile>-->
 
         <profile>
             <id>license-check</id>

Added: geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml?rev=1080093&view=auto
==============================================================================
--- geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml (added)
+++ geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml Thu Mar 10 01:14:53 2011
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!--
+    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.
+-->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>genesis</artifactId>
+        <groupId>org.apache.geronimo.genesis</groupId>
+        <version>2.1-SNAPSHOT</version>
+    </parent>
+    <artifactId>genesis-enforcer-rules</artifactId>
+    <name>Genesis Enforcer Rules</name>
+    <!--<properties>-->
+        <!--<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>-->
+    <!--</properties>-->
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven.enforcer</groupId>
+            <artifactId>enforcer-api</artifactId>
+            <version>1.0-beta-1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.maven</groupId>
+            <artifactId>maven-project</artifactId>
+            <version>2.2.1</version>
+        </dependency>
+    </dependencies>
+</project>

Propchange: geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/genesis/trunk/genesis-enforcer-rules/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java?rev=1080093&view=auto
==============================================================================
--- geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
(added)
+++ geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
Thu Mar 10 01:14:53 2011
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+
+package org.apache.geronimo.genesis.enforcer;
+
+import org.apache.maven.enforcer.rule.api.EnforcerRule;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ValidateConfiguration implements EnforcerRule {
+
+
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+
+        try {
+            String groupId = (String) helper.evaluate( "${project.groupId}" );
+            //do not apply validation to genesis projects as i
+            if (groupId.startsWith("org.apache.geronimo.genesis")) {
+                return;
+            }
+            check(helper, "project.description", "project/description", "Genesis provides");
+            check(helper, "project.scm.connection", "project/scm/connection", "scm:svn:http://svn.apache.org/repos/asf/geronimo/genesis");
+            check(helper, "project.scm.developerConnection", "project/scm/developerConnection",
"scm:svn:https://svn.apache.org/repos/asf/geronimo/genesis");
+            check(helper, "project.scm.url", "project/scm/url", "http://svn.apache.org/viewvc/geronimo/geronimo/genesis");
+        } catch (ExpressionEvaluationException e) {
+
+        }
+
+    }
+
+    private void check(EnforcerRuleHelper helper, String path, String xmlPath, String prefix)
throws ExpressionEvaluationException, EnforcerRuleException {
+        String actual = (String) helper.evaluate( "${" + path + "}" );
+        if (actual == null || actual.startsWith(prefix)) {
+            throw new EnforcerRuleException(xmlPath + " must be supplied");
+        }
+    }
+
+    public boolean isCacheable() {
+        return true;
+    }
+
+    public boolean isResultValid(EnforcerRule enforcerRule) {
+        return true;
+    }
+
+    public String getCacheId() {
+        return "";
+    }
+}

Propchange: geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/genesis/trunk/genesis-enforcer-rules/src/main/java/org/apache/geronimo/genesis/enforcer/ValidateConfiguration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/genesis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/pom.xml?rev=1080093&r1=1080092&r2=1080093&view=diff
==============================================================================
--- geronimo/genesis/trunk/pom.xml (original)
+++ geronimo/genesis/trunk/pom.xml Thu Mar 10 01:14:53 2011
@@ -16,18 +16,14 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
--->
-
-<!-- $Rev$ $Date$ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+--><!-- $Rev$ $Date$ --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
         <groupId>org.apache</groupId>
         <artifactId>apache</artifactId>
-        <version>6</version>
+        <version>7</version>
     </parent>
 
     <groupId>org.apache.geronimo.genesis</groupId>
@@ -124,22 +120,22 @@
         </site>
     </distributionManagement>
 
-    <repositories>
-        <repository>
-            <id>codehaus.snapshots</id>
-            <name>Codehaus Snapshots Repository</name>
-            <url>http://snapshots.repository.codehaus.org</url>
-            <layout>default</layout>
-            <snapshots>
-                <enabled>true</enabled>
-                <updatePolicy>daily</updatePolicy>
-                <checksumPolicy>ignore</checksumPolicy>
-            </snapshots>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-        </repository>
-    </repositories>
+    <!--<repositories>-->
+        <!--<repository>-->
+            <!--<id>codehaus.snapshots</id>-->
+            <!--<name>Codehaus Snapshots Repository</name>-->
+            <!--<url>http://snapshots.repository.codehaus.org</url>-->
+            <!--<layout>default</layout>-->
+            <!--<snapshots>-->
+                <!--<enabled>true</enabled>-->
+                <!--<updatePolicy>daily</updatePolicy>-->
+                <!--<checksumPolicy>ignore</checksumPolicy>-->
+            <!--</snapshots>-->
+            <!--<releases>-->
+                <!--<enabled>false</enabled>-->
+            <!--</releases>-->
+        <!--</repository>-->
+    <!--</repositories>-->
 
     <pluginRepositories>
 
@@ -158,28 +154,29 @@
             </releases>
         </pluginRepository>
 
-        <pluginRepository>
-            <id>codehaus.snapshots</id>
-            <name>Codehaus Snapshots Repository</name>
-            <url>http://snapshots.repository.codehaus.org</url>
-            <layout>default</layout>
-            <snapshots>
-                <enabled>true</enabled>
-                <updatePolicy>daily</updatePolicy>
-                <checksumPolicy>ignore</checksumPolicy>
-            </snapshots>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-        </pluginRepository>
+        <!--<pluginRepository>-->
+            <!--<id>codehaus.snapshots</id>-->
+            <!--<name>Codehaus Snapshots Repository</name>-->
+            <!--<url>http://snapshots.repository.codehaus.org</url>-->
+            <!--<layout>default</layout>-->
+            <!--<snapshots>-->
+                <!--<enabled>true</enabled>-->
+                <!--<updatePolicy>daily</updatePolicy>-->
+                <!--<checksumPolicy>ignore</checksumPolicy>-->
+            <!--</snapshots>-->
+            <!--<releases>-->
+                <!--<enabled>false</enabled>-->
+            <!--</releases>-->
+        <!--</pluginRepository>-->
     </pluginRepositories>
 
     <modules>
         <module>apache-source-release-assembly-descriptor</module>
-        <module>genesis-maven-plugin</module>
+        <!--<module>genesis-maven-plugin</module>-->
         <module>genesis-packaging</module>
         <module>genesis-default-flava</module>
         <!--<module>genesis-skin</module>-->
+        <module>genesis-enforcer-rules</module>
     </modules>
 
     <build>
@@ -307,7 +304,7 @@
                 <plugin>
                     <groupId>org.apache.felix</groupId>
                     <artifactId>maven-bundle-plugin</artifactId>
-                    <version>2.0.0</version>
+                    <version>2.0.1</version>
                     <extensions>true</extensions>
                 </plugin>
 
@@ -385,60 +382,60 @@
 
                 <!-- INTERNAL -->
 
-                <plugin>
-                    <groupId>org.apache.geronimo.genesis</groupId>
-                    <artifactId>genesis-maven-plugin</artifactId>
-                    <version>2.1-SNAPSHOT</version>
-                </plugin>
+                <!--<plugin>-->
+                    <!--<groupId>org.apache.geronimo.genesis</groupId>-->
+                    <!--<artifactId>genesis-maven-plugin</artifactId>-->
+                    <!--<version>2.1-SNAPSHOT</version>-->
+                <!--</plugin>-->
             </plugins>
         </pluginManagement>
     </build>
 
     <profiles>
-        <profile>
-            <id>apache-release</id>
-            <activation>
-                <property>
-                    <name>apache-release</name>
-                </property>
-            </activation>
-            <build>
-                <plugins>
-                    <!-- waiting for release -->
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-assembly-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>single</goal>
-                                </goals>
-                                <phase>package</phase>
-                                <configuration>
-                                    <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
-                                    <descriptorRefs>
-                                        <descriptorRef>
-                                            source-release
-                                        </descriptorRef>
-                                    </descriptorRefs>
-                                </configuration>
-                            </execution>
-                        </executions>
-                        <dependencies>
-                            <dependency>
-                                <!-- apache version not yet released -->
-                                <!--<groupId>org.apache</groupId>-->
-                                <groupId>org.apache.geronimo.genesis</groupId>
-                                <artifactId>apache-source-release-assembly-descriptor</artifactId>
-                                <!-- apache version not yet known -->
-                                <version>2.0</version>
-                            </dependency>
-                        </dependencies>
-                    </plugin>
-
-                </plugins>
-            </build>
-        </profile>
+        <!--<profile>-->
+            <!--<id>apache-release</id>-->
+            <!--<activation>-->
+                <!--<property>-->
+                    <!--<name>apache-release</name>-->
+                <!--</property>-->
+            <!--</activation>-->
+            <!--<build>-->
+                <!--<plugins>-->
+                    <!--&lt;!&ndash; waiting for release &ndash;&gt;-->
+                    <!--<plugin>-->
+                        <!--<groupId>org.apache.maven.plugins</groupId>-->
+                        <!--<artifactId>maven-assembly-plugin</artifactId>-->
+                        <!--<executions>-->
+                            <!--<execution>-->
+                                <!--<goals>-->
+                                    <!--<goal>single</goal>-->
+                                <!--</goals>-->
+                                <!--<phase>package</phase>-->
+                                <!--<configuration>-->
+                                    <!--<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>-->
+                                    <!--<descriptorRefs>-->
+                                        <!--<descriptorRef>-->
+                                            <!--source-release-->
+                                        <!--</descriptorRef>-->
+                                    <!--</descriptorRefs>-->
+                                <!--</configuration>-->
+                            <!--</execution>-->
+                        <!--</executions>-->
+                        <!--<dependencies>-->
+                            <!--<dependency>-->
+                                <!--&lt;!&ndash; apache version not yet released
&ndash;&gt;-->
+                                <!--&lt;!&ndash;<groupId>org.apache</groupId>&ndash;&gt;-->
+                                <!--<groupId>org.apache.geronimo.genesis</groupId>-->
+                                <!--<artifactId>apache-source-release-assembly-descriptor</artifactId>-->
+                                <!--&lt;!&ndash; apache version not yet known
&ndash;&gt;-->
+                                <!--<version>2.0</version>-->
+                            <!--</dependency>-->
+                        <!--</dependencies>-->
+                    <!--</plugin>-->
+
+                <!--</plugins>-->
+            <!--</build>-->
+        <!--</profile>-->
 
         <profile>
             <id>strict-enforcement</id>
@@ -481,5 +478,4 @@
         </profile>
     </profiles>
 
-</project>
-
+</project>
\ No newline at end of file



Mime
View raw message