Author: bentmann
Date: Sat Aug  9 03:55:14 2008
New Revision: 684220

URL: http://svn.apache.org/viewvc?rev=684220&view=rev
Log:
o Fixed regex-based intro/outtro detection to not hang/crash on real life POMs

Modified:
    
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
    
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/expected-pom.xml
    
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/pom.xml

Modified: 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java?rev=684220&r1=684219&r2=684220&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
 (original)
+++ 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
 Sat Aug  9 03:55:14 2008
@@ -152,13 +152,13 @@
                  * fail. So let's try harder. Maybe some day, when JDOM offers 
a StaxBuilder and this builder employes
                  * XMLInputFactory2.P_REPORT_PROLOG_WHITESPACE, this whole 
mess can be avoided.
                  */
-                final String SPACE = "\\s+";
-                final String XML = 
"<\\?(?:(?:[^\"'>]+)|(?:\"[^\"]*+\")|(?:'[^\']*+'))*>";
-                final String INTSUB = 
"\\[(?:(?:[^\"'\\]]+)|(?:\"[^\"]*+\")|(?:'[^\']*+'))*\\]";
+                final String SPACE = "\\s++";
+                final String XML = 
"<\\?(?:(?:[^\"'>]++)|(?:\"[^\"]*+\")|(?:'[^\']*+'))*+>";
+                final String INTSUB = 
"\\[(?:(?:[^\"'\\]]++)|(?:\"[^\"]*+\")|(?:'[^\']*+'))*+\\]";
                 final String DOCTYPE =
-                    
"<!DOCTYPE(?:(?:[^\"'\\[>]+)|(?:\"[^\"]*+\")|(?:'[^\']*+')|(?:" + INTSUB + 
"))*>";
+                    
"<!DOCTYPE(?:(?:[^\"'\\[>]++)|(?:\"[^\"]*+\")|(?:'[^\']*+')|(?:" + INTSUB + 
"))*+>";
                 final String PI = XML;
-                final String COMMENT = "<!--(?:[^-]|(?:-[^-]))*-->";
+                final String COMMENT = "<!--(?:[^-]|(?:-[^-]))*+-->";
 
                 final String INTRO =
                     "(?:(?:" + SPACE + ")|(?:" + XML + ")|(?:" + DOCTYPE + 
")|(?:" + COMMENT + ")|(?:" + PI + "))*";

Modified: 
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/expected-pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/expected-pom.xml?rev=684220&r1=684219&r2=684220&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/expected-pom.xml
 (original)
+++ 
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/expected-pom.xml
 Sat Aug  9 03:55:14 2008
@@ -18,9 +18,140 @@
 
 <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>
+
   <groupId>groupId</groupId>
   <artifactId>artifactId</artifactId>
   <version>1.0</version>
+  <packaging>jar</packaging>
+
+  <!-- NOTE: This comment is part of the test -->
+  <name>test</name>
+  <description>test</description>
+  <url>http://www.foo.bar/</url>
+
+  <organization>
+    <name>The Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+  <repositories>
+    <repository>
+      <id>apache.snapshots</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </repository>
+  </repositories>
+
+  <distributionManagement>
+    <!-- Site omitted - each project must provide their own -->
+    <repository>
+      <id>apache.releases</id>
+      <name>Apache Release Distribution Repository</name>
+      
<url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
+    </repository>
+    <snapshotRepository>
+      <id>apache.snapshots</id>
+      <name>Apache Development Snapshot Repository</name>
+      
<url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+  <mailingLists>
+    <mailingList>
+      <name>Apache Announce List</name>
+      <subscribe>[EMAIL PROTECTED]</subscribe>
+      <unsubscribe>[EMAIL PROTECTED]</unsubscribe>
+      <post>[EMAIL PROTECTED]</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/www-announce/</archive>
+    </mailingList>
+  </mailingLists>
+
+  <properties>
+    
<organization.logo>http://www.apache.org/images/asf_logo_wide.gif</organization.logo>
+  </properties>
+
+  <profiles>
+    <profile>
+      <id>run-its</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <version>1.2</version>
+            <configuration>
+              <projectsDirectory>src/it</projectsDirectory>
+              <pomIncludes>
+                <pomInclude>**/pom.xml</pomInclude>
+              </pomIncludes>
+              <pomExcludes>
+                <pomExclude>MWAR-143/war-common/pom.xml</pomExclude>
+                <pomExclude>MWAR-143/war-filter-overlay/pom.xml</pomExclude>
+                <pomExclude>MWAR-131/mwar131-test/pom.xml</pomExclude>
+                <pomExclude>MWAR-131/mwar131-webapp/pom.xml</pomExclude>
+                <pomExclude>MWAR-131/mwar131-webapp2/pom.xml</pomExclude>
+                <pomExclude>**/META-INF/**/pom.xml</pomExclude>
+              </pomExcludes>
+              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+              <goals>
+                <goal>clean</goal>
+                <goal>package</goal>
+              </goals>
+              <settingsFile>src/it/settings.xml</settingsFile>
+              <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <goals>
+                  <goal>install</goal>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- TODO: Remove this plugin execution once MINVOKER-43 is released 
-->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-install-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>it-preparation</id>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>install-file</goal>
+                </goals>
+                <configuration>
+                  
<file>${project.build.directory}/${project.build.finalName}.jar</file>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>${project.artifactId}</artifactId>
+                  <version>${project.version}</version>
+                  <packaging>${project.packaging}</packaging>
+                  <pomFile>${basedir}/pom.xml</pomFile>
+                  <createChecksum>true</createChecksum>
+                  
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+                  <!-- NOTE: must match identifier of real local repository or 
metadata lookup during ITs will misbehave -->
+                  <localRepositoryId>local</localRepositoryId>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
 
 <!-- THE END -->

Modified: 
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/pom.xml?rev=684220&r1=684219&r2=684220&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/pom.xml
 (original)
+++ 
maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/basic-pom-namespace/pom.xml
 Sat Aug  9 03:55:14 2008
@@ -20,9 +20,140 @@
          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>
+
   <groupId>groupId</groupId>
   <artifactId>artifactId</artifactId>
   <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <!-- NOTE: This comment is part of the test -->
+  <name>test</name>
+  <description>test</description>
+  <url>http://www.foo.bar/</url>
+
+  <organization>
+    <name>The Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+  <repositories>
+    <repository>
+      <id>apache.snapshots</id>
+      <name>Apache Snapshot Repository</name>
+      <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+    </repository>
+  </repositories>
+
+  <distributionManagement>
+    <!-- Site omitted - each project must provide their own -->
+    <repository>
+      <id>apache.releases</id>
+      <name>Apache Release Distribution Repository</name>
+      
<url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
+    </repository>
+    <snapshotRepository>
+      <id>apache.snapshots</id>
+      <name>Apache Development Snapshot Repository</name>
+      
<url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+  <mailingLists>
+    <mailingList>
+      <name>Apache Announce List</name>
+      <subscribe>[EMAIL PROTECTED]</subscribe>
+      <unsubscribe>[EMAIL PROTECTED]</unsubscribe>
+      <post>[EMAIL PROTECTED]</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/www-announce/</archive>
+    </mailingList>
+  </mailingLists>
+
+  <properties>
+    
<organization.logo>http://www.apache.org/images/asf_logo_wide.gif</organization.logo>
+  </properties>
+
+  <profiles>
+    <profile>
+      <id>run-its</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <version>1.2</version>
+            <configuration>
+              <projectsDirectory>src/it</projectsDirectory>
+              <pomIncludes>
+                <pomInclude>**/pom.xml</pomInclude>
+              </pomIncludes>
+              <pomExcludes>
+                <pomExclude>MWAR-143/war-common/pom.xml</pomExclude>
+                <pomExclude>MWAR-143/war-filter-overlay/pom.xml</pomExclude>
+                <pomExclude>MWAR-131/mwar131-test/pom.xml</pomExclude>
+                <pomExclude>MWAR-131/mwar131-webapp/pom.xml</pomExclude>
+                <pomExclude>MWAR-131/mwar131-webapp2/pom.xml</pomExclude>
+                <pomExclude>**/META-INF/**/pom.xml</pomExclude>
+              </pomExcludes>
+              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+              <goals>
+                <goal>clean</goal>
+                <goal>package</goal>
+              </goals>
+              <settingsFile>src/it/settings.xml</settingsFile>
+              <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <goals>
+                  <goal>install</goal>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- TODO: Remove this plugin execution once MINVOKER-43 is released 
-->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-install-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>it-preparation</id>
+                <phase>pre-integration-test</phase>
+                <goals>
+                  <goal>install-file</goal>
+                </goals>
+                <configuration>
+                  
<file>${project.build.directory}/${project.build.finalName}.jar</file>
+                  <groupId>${project.groupId}</groupId>
+                  <artifactId>${project.artifactId}</artifactId>
+                  <version>${project.version}</version>
+                  <packaging>${project.packaging}</packaging>
+                  <pomFile>${basedir}/pom.xml</pomFile>
+                  <createChecksum>true</createChecksum>
+                  
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
+                  <!-- NOTE: must match identifier of real local repository or 
metadata lookup during ITs will misbehave -->
+                  <localRepositoryId>local</localRepositoryId>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 </project>
 
 <!-- THE END -->


Reply via email to