You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2012/06/08 17:15:54 UTC

svn commit: r1348106 - in /incubator/syncope/trunk: archetype/ archetype/src/main/resources/ archetype/src/main/resources/archetype-resources/ archetype/src/main/resources/archetype-resources/console/ archetype/src/main/resources/archetype-resources/co...

Author: ilgrosso
Date: Fri Jun  8 15:15:53 2012
New Revision: 1348106

URL: http://svn.apache.org/viewvc?rev=1348106&view=rev
Log:
[SYNCOPE-92] Ok, only XSLT could save us: parent POM is now generated by an XSLT transformation, with correct Syncope version as input parameter

Added:
    incubator/syncope/trunk/archetype/src/main/resources/meta-pom.xml
      - copied, changed from r1348066, incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/pom.xml
    incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl   (with props)
Removed:
    incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/pom.xml
Modified:
    incubator/syncope/trunk/archetype/pom.xml
    incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/   (props changed)
    incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml
    incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml
    incubator/syncope/trunk/parent/pom.xml
    incubator/syncope/trunk/parent/src/site/xdoc/release-process.xml

Modified: incubator/syncope/trunk/archetype/pom.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/archetype/pom.xml?rev=1348106&r1=1348105&r2=1348106&view=diff
==============================================================================
--- incubator/syncope/trunk/archetype/pom.xml (original)
+++ incubator/syncope/trunk/archetype/pom.xml Fri Jun  8 15:15:53 2012
@@ -65,6 +65,51 @@ under the License.
     </pluginManagement>
 
     <plugins>
+      <!-- Generate project's parent POM and dynamically sets Syncope version -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>xml-maven-plugin</artifactId>
+        <inherited>true</inherited>
+        <executions>
+          <execution>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>transform</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <transformationSets>
+            <transformationSet>
+              <dir>${basedir}/src/main/resources</dir>
+              <includes>
+                <include>meta-pom.xml</include>
+              </includes>
+              <outputDir>${basedir}/src/main/resources/archetype-resources</outputDir>
+              <stylesheet>${basedir}/src/main/resources/properties2pom.xsl</stylesheet>
+              <parameters>
+                <parameter>
+                  <name>syncopeVersion</name>
+                  <value>${project.version}</value>
+                </parameter>
+              </parameters>
+              <outputProperties>
+                <outputProperty>
+                  <name>indent</name>
+                  <value>yes</value>
+                </outputProperty>
+              </outputProperties>
+              <fileMappers>
+                <fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
+                  <pattern>^meta-(.*)\.xml$</pattern>
+                  <replacement>$1.xml</replacement>
+                </fileMapper>
+              </fileMappers>
+            </transformationSet>
+          </transformationSets>
+        </configuration>
+      </plugin>
+      
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>

Propchange: incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jun  8 15:15:53 2012
@@ -0,0 +1,2 @@
+pom.xml
+.svn-prop.tmp.swp

Modified: incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml?rev=1348106&r1=1348105&r2=1348106&view=diff
==============================================================================
--- incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml (original)
+++ incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/console/pom.xml Fri Jun  8 15:15:53 2012
@@ -81,7 +81,6 @@ under the License.
     <dependency>
       <groupId>org.apache.syncope</groupId>
       <artifactId>syncope-build-tools</artifactId>
-      <version>${syncope.version}</version>
       <type>war</type>
       <scope>test</scope>
     </dependency>
@@ -138,7 +137,7 @@ under the License.
     <finalName>syncope-console</finalName>
 
     <plugins>
-
+      
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>

Modified: incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml?rev=1348106&r1=1348105&r2=1348106&view=diff
==============================================================================
--- incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml (original)
+++ incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/core/pom.xml Fri Jun  8 15:15:53 2012
@@ -99,11 +99,10 @@ under the License.
       <artifactId>groovy-all</artifactId>
     </dependency>
 
-<!-- TEST -->
+    <!-- TEST -->
     <dependency>
       <groupId>org.apache.syncope</groupId>
       <artifactId>syncope-build-tools</artifactId>
-      <version>${syncope.version}</version>
       <type>war</type>
       <scope>test</scope>
     </dependency>

Copied: incubator/syncope/trunk/archetype/src/main/resources/meta-pom.xml (from r1348066, incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/archetype/src/main/resources/meta-pom.xml?p2=incubator/syncope/trunk/archetype/src/main/resources/meta-pom.xml&p1=incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/pom.xml&r1=1348066&r2=1348106&rev=1348106&view=diff
==============================================================================
--- incubator/syncope/trunk/archetype/src/main/resources/archetype-resources/pom.xml (original)
+++ incubator/syncope/trunk/archetype/src/main/resources/meta-pom.xml Fri Jun  8 15:15:53 2012
@@ -28,11 +28,11 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.0.0-incubating-SNAPSHOT</version>
+    <version></version>
   </parent>
 
   <properties>
-    <syncope.version>1.0.0-incubating-SNAPSHOT</syncope.version>
+    <syncope.version></syncope.version>
   </properties>
 
   <name>Apache Syncope sample project</name>
@@ -54,6 +54,7 @@ under the License.
         <artifactId>syncope-build-tools</artifactId>
         <version>${syncope.version}</version>
         <type>war</type>
+        <scope>test</scope>
       </dependency> 
             
       <dependency>
@@ -111,7 +112,7 @@ under the License.
     </pluginManagement>
     
     <!-- Disable legal check for generated projects: see SYNCOPE-84 -->
-    <plugins>      
+    <plugins>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>ianal-maven-plugin</artifactId>

Added: incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl?rev=1348106&view=auto
==============================================================================
--- incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl (added)
+++ incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl Fri Jun  8 15:15:53 2012
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+ -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:m="http://maven.apache.org/POM/4.0.0"
+                exclude-result-prefixes="m"
+                version="1.0">
+  <xsl:param name="syncopeVersion"/>
+  
+  <xsl:template match="/m:project/m:parent/m:version">
+    <version>
+      <xsl:value-of select="$syncopeVersion"/>
+    </version>
+  </xsl:template>
+
+  <xsl:template match="/m:project/m:properties/m:syncope.version">
+    <syncope.version>
+      <xsl:value-of select="$syncopeVersion"/>
+    </syncope.version>
+  </xsl:template>
+  
+  <xsl:template match="node()|@*|comment()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/syncope/trunk/archetype/src/main/resources/properties2pom.xsl
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/syncope/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/parent/pom.xml?rev=1348106&r1=1348105&r2=1348106&view=diff
==============================================================================
--- incubator/syncope/trunk/parent/pom.xml (original)
+++ incubator/syncope/trunk/parent/pom.xml Fri Jun  8 15:15:53 2012
@@ -789,6 +789,11 @@ under the License.
           </dependencies>
         </plugin>
         <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>xml-maven-plugin</artifactId>
+          <version>1.0</version>
+        </plugin>
+        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <version>2.12</version>

Modified: incubator/syncope/trunk/parent/src/site/xdoc/release-process.xml
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/parent/src/site/xdoc/release-process.xml?rev=1348106&r1=1348105&r2=1348106&view=diff
==============================================================================
--- incubator/syncope/trunk/parent/src/site/xdoc/release-process.xml (original)
+++ incubator/syncope/trunk/parent/src/site/xdoc/release-process.xml Fri Jun  8 15:15:53 2012
@@ -119,10 +119,6 @@ under the License.
             from JIRA.
           </li>
           <li>
-            Update parent POM version in <tt>archetype/src/main/resources/archetype-resources/pom.xml</tt>
-            to the ongoing release number.
-          </li>
-          <li>
             Commit any changes back to svn:
             <source>svn commit -m "updating files for release"</source>
           </li>