You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2010/09/29 14:52:41 UTC
svn commit: r1002593 - in /maven/release/trunk/maven-release-plugin: ./
src/it/projects/branch/ src/it/projects/branch/MRELEASE-458/
src/it/projects/flat-multi-module/ src/it/projects/forked-basic/
src/it/projects/invoker-basic/ src/it/projects/prepare...
Author: brett
Date: Wed Sep 29 12:52:40 2010
New Revision: 1002593
URL: http://svn.apache.org/viewvc?rev=1002593&view=rev
Log:
[MRELEASE-458] add integration test to illustrate that the branch goal does not check in POMs on the working copy
Submitted by: Peter Janes
Added:
maven/release/trunk/maven-release-plugin/src/it/projects/branch/
maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/
maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml (with props)
maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.bsh
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/flat-multi-module/
- copied from r1002110, maven/release/trunk/maven-release-plugin/src/it/projects/flat-multi-module/
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/forked-basic/
- copied from r1002110, maven/release/trunk/maven-release-plugin/src/it/projects/forked-basic/
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/invoker-basic/
- copied from r1002110, maven/release/trunk/maven-release-plugin/src/it/projects/invoker-basic/
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/regular-multi-module/
- copied from r1002110, maven/release/trunk/maven-release-plugin/src/it/projects/regular-multi-module/
maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubBranchCommand.java (with props)
Removed:
maven/release/trunk/maven-release-plugin/src/it/projects/flat-multi-module/
maven/release/trunk/maven-release-plugin/src/it/projects/forked-basic/
maven/release/trunk/maven-release-plugin/src/it/projects/invoker-basic/
maven/release/trunk/maven-release-plugin/src/it/projects/regular-multi-module/
Modified:
maven/release/trunk/maven-release-plugin/pom.xml
maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubScmProvider.java
Modified: maven/release/trunk/maven-release-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/pom.xml?rev=1002593&r1=1002592&r2=1002593&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/pom.xml (original)
+++ maven/release/trunk/maven-release-plugin/pom.xml Wed Sep 29 12:52:40 2010
@@ -176,13 +176,6 @@
<configuration>
<projectsDirectory>src/it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
- <setupIncludes>
- <setupInclude>setup/maven-scm-provider-*/pom.xml</setupInclude>
- </setupIncludes>
- <pomIncludes>
- <pomInclude>projects/*/pom.xml</pomInclude>
- <pomInclude>projects/flat-multi-module/parent-project/pom.xml</pomInclude>
- </pomIncludes>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
@@ -191,15 +184,41 @@
<allowReleasePluginSnapshot>true</allowReleasePluginSnapshot>
<dryRun>true</dryRun>
</properties>
- <goals>
- <goal>clean</goal>
- <goal>${project.groupId}:${project.artifactId}:${project.version}:clean</goal>
- <goal>${project.groupId}:${project.artifactId}:${project.version}:prepare</goal>
- </goals>
</configuration>
<executions>
<execution>
- <id>integration-test</id>
+ <id>integration-test-prepare</id>
+ <configuration>
+ <setupIncludes>
+ <setupInclude>setup/maven-scm-provider-*/pom.xml</setupInclude>
+ </setupIncludes>
+ <pomIncludes>
+ <pomInclude>projects/prepare/*/pom.xml</pomInclude>
+ <pomInclude>projects/prepare/flat-multi-module/parent-project/pom.xml</pomInclude>
+ </pomIncludes>
+ <goals>
+ <goal>clean</goal>
+ <goal>${project.groupId}:${project.artifactId}:${project.version}:clean</goal>
+ <goal>${project.groupId}:${project.artifactId}:${project.version}:prepare</goal>
+ </goals>
+ </configuration>
+ <goals>
+ <goal>install</goal>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>integration-test-branch</id>
+ <configuration>
+ <pomIncludes>
+ <pomInclude>projects/branch/*/pom.xml</pomInclude>
+ </pomIncludes>
+ <goals>
+ <goal>clean</goal>
+ <goal>${project.groupId}:${project.artifactId}:${project.version}:clean</goal>
+ <goal>${project.groupId}:${project.artifactId}:${project.version}:branch</goal>
+ </goals>
+ </configuration>
<goals>
<goal>install</goal>
<goal>run</goal>
Added: maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml?rev=1002593&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml Wed Sep 29 12:52:40 2010
@@ -0,0 +1,79 @@
+<!--
+ ~ 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.
+ -->
+
+ <!--
+ 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 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>org.apache.maven.plugin.release.it</groupId>
+ <artifactId>test-release-branch</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>Maven Quick Start Archetype</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <scm>
+ <connection>scm:stub|</connection>
+ <developerConnection>scm:stub|</developerConnection>
+ </scm>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <updateWorkingCopyVersions>false</updateWorkingCopyVersions>
+ <updateBranchVersions>true</updateBranchVersions>
+ <branchName>test-1.0.x</branchName>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.release</groupId>
+ <artifactId>maven-scm-provider-stub</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.bsh
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.bsh?rev=1002593&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.bsh (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/branch/MRELEASE-458/verify.bsh Wed Sep 29 12:52:40 2010
@@ -0,0 +1,40 @@
+import java.io.*;
+import java.util.*;
+import java.util.regex.*;
+
+try
+{
+ File buildLog = new File( basedir, "build.log" );
+
+ System.out.println( "Checking logs..." );
+
+ StringBuffer data = new StringBuffer( 1024 );
+ BufferedReader reader = new BufferedReader( new FileReader( buildLog ) );
+ char[] buf = new char[1024];
+ int numRead = 0;
+ while ( ( numRead = reader.read( buf ) ) != -1 )
+ {
+ String readData = String.valueOf( buf, 0, numRead );
+ data.append( readData );
+ buf = new char[1024];
+ }
+ reader.close();
+ String contents = data.toString();
+
+ String one_expected = "Checking in modified POMs";
+
+ int pos = contents.indexOf( one_expected );
+
+ if( contents.indexOf( one_expected, pos ) == -1 )
+ {
+ return true;
+ }
+}
+catch( Throwable t )
+{
+ t.printStackTrace();
+ return false;
+}
+
+System.out.println( "FAILED!" );
+return false;
Added: maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubBranchCommand.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubBranchCommand.java?rev=1002593&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubBranchCommand.java (added)
+++ maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubBranchCommand.java Wed Sep 29 12:52:40 2010
@@ -0,0 +1,49 @@
+package org.apache.maven.scm.provider.stub;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+
+import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.AbstractCommand;
+import org.apache.maven.scm.command.branch.BranchScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+
+/**
+ * A dummy branch command.
+ *
+ * @author Peter Janes
+ * @version $Id$
+ */
+class StubBranchCommand
+ extends AbstractCommand
+{
+
+ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet fileSet,
+ CommandParameters parameters )
+ throws ScmException
+ {
+ return new BranchScmResult( null, new ArrayList() );
+ }
+
+}
Propchange: maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubBranchCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubScmProvider.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubScmProvider.java?rev=1002593&r1=1002592&r2=1002593&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubScmProvider.java (original)
+++ maven/release/trunk/maven-release-plugin/src/it/setup/maven-scm-provider-stub/src/main/java/org/apache/maven/scm/provider/stub/StubScmProvider.java Wed Sep 29 12:52:40 2010
@@ -24,6 +24,7 @@ import org.apache.maven.scm.ScmException
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.Command;
+import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.command.checkout.CheckOutScmResult;
import org.apache.maven.scm.command.status.StatusScmResult;
@@ -83,6 +84,13 @@ public class StubScmProvider
return (CheckOutScmResult) executeCommand( new StubCheckOutCommand(), repository, fileSet, parameters );
}
+ protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet,
+ CommandParameters parameters )
+ throws ScmException
+ {
+ return (BranchScmResult) executeCommand( new StubBranchCommand(), repository, fileSet, parameters );
+ }
+
protected TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
throws ScmException
{