Skip to content

Commit

Permalink
o Fixed regex-based intro/outtro detection to not hang/crash on real …
Browse files Browse the repository at this point in the history
…life POMs

git-svn-id: https://svn.apache.org/repos/asf/maven/release/trunk@684220 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bentmann committed Aug 9, 2008
1 parent 5460603 commit 5493980
Show file tree
Hide file tree
Showing 3 changed files with 267 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ private void transformProject( MavenProject project, ReleaseDescriptor releaseDe
* 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 + "))*";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>announce-subscribe@apache.org</subscribe>
<unsubscribe>announce-unsubscribe@apache.org</unsubscribe>
<post>announce@apache.org</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 -->
Original file line number Diff line number Diff line change
Expand Up @@ -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>announce-subscribe@apache.org</subscribe>
<unsubscribe>announce-unsubscribe@apache.org</unsubscribe>
<post>announce@apache.org</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 -->

0 comments on commit 5493980

Please sign in to comment.