maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1329106 [1/6] - in /maven/scm/trunk: ./ maven-scm-client/ maven-scm-client/src/main/resources/META-INF/plexus/ maven-scm-providers/ maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/...
Date Mon, 23 Apr 2012 07:45:38 GMT
Author: olamy
Date: Mon Apr 23 07:45:33 2012
New Revision: 1329106

URL: http://svn.apache.org/viewvc?rev=1329106&view=rev
Log:
[SCM-670] Support Jazz SCM.
Submitted by Chris Graham.

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/branch/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/branch/JazzBranchCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/changelog/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/changelog/JazzChangeLogCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/changelog/JazzHistoryConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/changelog/JazzListChangesetConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkin/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkin/JazzCheckInCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkin/JazzCheckInConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/consumer/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/consumer/AbstractRepositoryConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/consumer/DebugLoggerConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/consumer/ErrorConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/diff/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/diff/JazzDiffCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/edit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/edit/JazzEditCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/list/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/list/JazzListCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/list/JazzListConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/status/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/status/JazzStatusCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/status/JazzStatusConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/tag/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/tag/JazzTagCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/unedit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/unedit/JazzUnEditCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/update/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/update/JazzUpdateCommand.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/update/JazzUpdateConsumer.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/repository/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/repository/JazzScmProviderRepository.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/site/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/site/apt/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/site/apt/index.apt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/site/apt/releases.apt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/site/apt/tcktests.apt   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/site/site.xml   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/JazzScmTestCase.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/JazzTckUtil.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/add/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/blame/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/branch/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/branch/JazzBranchCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/changelog/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/changelog/JazzChangeLogCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/changelog/JazzChangeLogCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/checkin/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/checkin/JazzCheckInCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/checkin/JazzCheckInCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/checkout/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/checkout/JazzCheckOutCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/consumer/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/consumer/DebugLoggerConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/consumer/ErrorConsumerTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/diff/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/diff/JazzDiffCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/diff/JazzDiffCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/edit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/edit/JazzEditCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/list/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/list/JazzListCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/status/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/status/JazzStatusCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/status/JazzStatusCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/tag/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/tag/JazzTagCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/tag/JazzTagCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/unedit/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/unedit/JazzUnEditCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/update/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/update/JazzUpdateCommandTckTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/command/update/JazzUpdateCommandTest.java   (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/repository/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/test/java/org/apache/maven/scm/provider/jazz/repository/JazzScmProviderRepositoryTest.java   (with props)
    maven/scm/trunk/src/site/apt/jazz.apt   (with props)
Modified:
    maven/scm/trunk/maven-scm-client/pom.xml
    maven/scm/trunk/maven-scm-client/src/main/resources/META-INF/plexus/components.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AccuRevTckUtil.java
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gittest/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-providers-standard/pom.xml
    maven/scm/trunk/maven-scm-providers/pom.xml
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTckTestCase.java
    maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/ScmTestCase.java
    maven/scm/trunk/pom.xml
    maven/scm/trunk/src/site/site.xml
    maven/scm/trunk/src/site/xdoc/matrix.xml

Modified: maven/scm/trunk/maven-scm-client/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-client/pom.xml?rev=1329106&r1=1329105&r2=1329106&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-client/pom.xml (original)
+++ maven/scm/trunk/maven-scm-client/pom.xml Mon Apr 23 07:45:33 2012
@@ -70,6 +70,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-jazz</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-local</artifactId>
     </dependency>
     <dependency>

Modified: maven/scm/trunk/maven-scm-client/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-client/src/main/resources/META-INF/plexus/components.xml?rev=1329106&r1=1329105&r2=1329106&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-client/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/scm/trunk/maven-scm-client/src/main/resources/META-INF/plexus/components.xml Mon Apr 23 07:45:33 2012
@@ -99,5 +99,11 @@ under the License.
       <role-hint>vss</role-hint>
       <implementation>org.apache.maven.scm.provider.vss.VssScmProvider</implementation>
     </component>
+    <component>
+      <role>org.apache.maven.scm.provider.ScmProvider</role>
+      <role-hint>jazz</role-hint>
+      <implementation>org.apache.maven.scm.provider.jazz.JazzScmProvider</implementation>
+      <description>A Maven SCM Provider for IBM Jazz SCM (http://jazz.net/).</description>
+    </component>
   </components>
 </component-set>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AccuRevTckUtil.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AccuRevTckUtil.java?rev=1329106&r1=1329105&r2=1329106&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AccuRevTckUtil.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-accurev/src/test/java/org/apache/maven/scm/provider/accurev/command/AccuRevTckUtil.java Mon Apr 23 07:45:33 2012
@@ -130,8 +130,9 @@ public class AccuRevTckUtil
         getAccuRevCL().mkstream( getDepotName(), newStreamName );
 
         /*
-         * Since scmFileNames is not populated before this is called... we get to duplicate some code here. TODO raise
-         * patch to fix this.
+         * Since scmFileNames is not populated before this is called... we get to duplicate some code here.
+         * ChrisGWarp: It is now! :-)
+         * TODO raise patch to fix this. (still)
          */
 
         List<String> scmFileNames = new ArrayList<String>( 4 );
@@ -173,7 +174,6 @@ public class AccuRevTckUtil
                 tckBaseDir = ScmTestCase.getBasedir();
             }
             getLogger().debug( "tckBaseDir=" + tckBaseDir );
-
         }
 
         return tckBaseDir;

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml Mon Apr 23 07:45:33 2012
@@ -0,0 +1,122 @@
+<?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.
+    -->
+
+<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.maven.scm</groupId>
+        <artifactId>maven-scm-providers</artifactId>
+        <version>1.7-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>maven-scm-provider-jazz</artifactId>
+
+    <name>Maven SCM Jazz/Rational Team Concert Provider</name>
+    <description>A Maven SCM Provider for IBM Jazz SCM (http://jazz.net/).</description>
+
+    <developers>
+        <developer>
+            <id>ChrisGWarp</id>
+            <name>Chris Graham</name>
+            <email>ChrisGWarp@gmail.com</email>
+            <organization>WarpSpeed Computers</organization>
+            <roles>
+                <role>developer</role>
+            </roles>
+            <timezone>10</timezone>
+        </developer>
+    </developers>
+
+    <dependencies>
+        <!-- For the RE's used to parse command line output -->
+        <dependency>
+            <groupId>regexp</groupId>
+            <artifactId>regexp</artifactId>
+        </dependency>
+        <!-- For the tck tests -->
+        <dependency>
+            <groupId>org.apache.maven.scm</groupId>
+            <artifactId>maven-scm-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>create-component-descriptor</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>descriptor</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <forkMode>never</forkMode>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>tck-jazz</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <forkMode>never</forkMode>
+                            <excludes>
+                                <exclude>nothing</exclude>
+                            </excludes>
+                            <systemProperties>
+                                <property>
+                                    <name>tckBaseDir</name>
+                                    <value>${tckBaseDir}</value>
+                                </property>
+                                <property>
+                                    <name>tckUrl</name>
+                                    <value>${tckUrl}</value>
+                                </property>
+                                <property>
+                                    <name>tckSnapshotName</name>
+                                    <value>${tckSnapshotName}</value>
+                                </property>
+                            </systemProperties>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java Mon Apr 23 07:45:33 2012
@@ -0,0 +1,402 @@
+package org.apache.maven.scm.provider.jazz;
+
+/*
+ * 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.net.URI;
+
+import org.apache.maven.scm.CommandParameters;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmResult;
+import org.apache.maven.scm.command.branch.BranchScmResult;
+import org.apache.maven.scm.command.changelog.ChangeLogScmResult;
+import org.apache.maven.scm.command.checkin.CheckInScmResult;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.command.diff.DiffScmResult;
+import org.apache.maven.scm.command.edit.EditScmResult;
+import org.apache.maven.scm.command.export.ExportScmResult;
+import org.apache.maven.scm.command.list.ListScmResult;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.command.tag.TagScmResult;
+import org.apache.maven.scm.command.unedit.UnEditScmResult;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.provider.AbstractScmProvider;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.jazz.command.JazzConstants;
+import org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand;
+import org.apache.maven.scm.provider.jazz.command.blame.JazzBlameCommand;
+import org.apache.maven.scm.provider.jazz.command.branch.JazzBranchCommand;
+import org.apache.maven.scm.provider.jazz.command.changelog.JazzChangeLogCommand;
+import org.apache.maven.scm.provider.jazz.command.checkin.JazzCheckInCommand;
+import org.apache.maven.scm.provider.jazz.command.checkout.JazzCheckOutCommand;
+import org.apache.maven.scm.provider.jazz.command.diff.JazzDiffCommand;
+import org.apache.maven.scm.provider.jazz.command.edit.JazzEditCommand;
+import org.apache.maven.scm.provider.jazz.command.list.JazzListCommand;
+import org.apache.maven.scm.provider.jazz.command.status.JazzStatusCommand;
+import org.apache.maven.scm.provider.jazz.command.tag.JazzTagCommand;
+import org.apache.maven.scm.provider.jazz.command.unedit.JazzUnEditCommand;
+import org.apache.maven.scm.provider.jazz.command.update.JazzUpdateCommand;
+import org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+
+/**
+ * The maven scm provider for Jazz.
+ * <P>
+ * This provider is a wrapper for the command line tool, "scm.sh" or "scm.exe" is that is
+ * part of the Jazz SCM Server.
+ * <P>
+ * This provider does not use a native API to communicate with the Jazz SCM server.
+ * <P>
+ * The scm tool itself is documented at: 
+ * V2.0.0  - http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
+ * V3.0    - http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
+ * V3.0.1  - http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
+ *
+ * @author <a href="mailto:ChrisGWarp@gmail.com">Chris Graham</a>
+ * 
+ * @plexus.component role="org.apache.maven.scm.provider.ScmProvider" role-hint="jazz"
+ */
+public class JazzScmProvider
+    extends AbstractScmProvider
+{
+    // Example: scm:jazz:daviddl;passw0rd123@https://localhost:9443/jazz:Dave's Repository Workspace
+    // If the username or password is supplied, then the @ must be used to delimit them.
+    public static final String JAZZ_URL_FORMAT =
+        "scm:jazz:[username[;password]@]http[s]://server_name[:port]/contextRoot:repositoryWorkspace";
+
+    // ----------------------------------------------------------------------
+    // ScmProvider Implementation
+    // ----------------------------------------------------------------------
+
+    public String getScmType()
+    {
+        return JazzConstants.SCM_TYPE;
+    }
+    
+    /**
+     * This method parses the scm URL and returns a SCM provider repository.
+     * At this point, the scmUrl is the part after scm:provider_name: in your SCM URL.
+     * <P>
+     * The basic url parsing approach is to be as loose as possible.
+     * If you specify as per the docs you'll get what you expect.
+     * If you do something else the result is undefined.
+     * Don't use "/" "\" or "@" as the delimiter.
+     * <P>
+     * Parse the scmUrl, which will be of the form:
+     * [username[;password]@]http[s]://server_name[:port]/contextRoot:repositoryWorkspace
+     * eg:
+     * Deb;Deb@https://rtc:9444/jazz:BogusRepositoryWorkspace
+     * {@inheritDoc}
+     */
+    public ScmProviderRepository makeProviderScmRepository( String scmUrl, char delimiter )
+        throws ScmRepositoryException
+    {
+        // Called from:
+        // AbstractScmProvider.makeScmRepository()
+        // AbstractScmProvider.validateScmUrl()
+        getLogger().debug( "JazzScmProvider:makeProviderScmRepository" );
+        getLogger().debug( "Provided scm url   - " + scmUrl );
+        getLogger().debug( "Provided delimiter - '" + delimiter + "'" );
+
+        String jazzUrlAndWorkspace = null;       
+        String usernameAndPassword = null;
+        
+        // Look for the Jazz URL after any '@' delimiter used to pass
+        // username/password etc (which may not have been specified)
+        int lastAtPosition = scmUrl.lastIndexOf( '@' );
+        if ( lastAtPosition == -1)
+        {
+            // The username;password@ was not supplied.
+            jazzUrlAndWorkspace = scmUrl;       
+        }
+        else
+        {
+            // The username@ or username;password@ was supplied.
+            jazzUrlAndWorkspace = ( lastAtPosition < 0 ) ? scmUrl : scmUrl.substring( lastAtPosition + 1 );       
+            usernameAndPassword = ( lastAtPosition < 0 ) ? null : scmUrl.substring( 0, lastAtPosition );
+        }
+
+        // jazzUrlAndWorkspace should be: http[s]://server_name:port/contextRoot:repositoryWorkspace
+        // usernameAndPassword should be: username;password or null
+
+
+        // username and password may not be supplied, and so may remain null.
+        String username = null;
+        String password = null;
+
+        if (usernameAndPassword != null)
+        {
+            // Can be:
+            // username
+            // username;password
+            int delimPosition = usernameAndPassword.indexOf(';');
+            username = delimPosition >= 0 ? usernameAndPassword.substring(0, delimPosition) : usernameAndPassword;
+            password = delimPosition >= 0 ? usernameAndPassword.substring(delimPosition + 1) : null;
+        }
+
+        
+        // We will now validate the jazzUrlAndWorkspace for right number of colons.
+        // This has been observed in the wild, where the contextRoot:repositoryWorkspace was not properly formed
+        // and this resulted in very strange results in the way in which things were parsed.
+        int colonsCounted = 0;
+        int colonIndex = 0;
+        while (colonIndex != -1)
+        {
+            colonIndex = jazzUrlAndWorkspace.indexOf( ":", colonIndex + 1 );
+            if (colonIndex != -1)
+            {
+                colonsCounted++;
+            }
+        }
+        // havePort may also be true when port is supplied, but otherwise have a malformed URL.
+        boolean havePort = colonsCounted == 3;
+
+        // Look for workspace after the end of the Jazz URL
+        int repositoryWorkspacePosition = jazzUrlAndWorkspace.lastIndexOf( delimiter );
+        String repositoryWorkspace = jazzUrlAndWorkspace.substring( repositoryWorkspacePosition + 1 );
+        String jazzUrl = jazzUrlAndWorkspace.substring( 0, repositoryWorkspacePosition );
+
+        // Validate the protocols.
+        try
+        {
+            // Determine if it is a valid URI.
+            URI jazzUri = URI.create( jazzUrl );
+            String scheme = jazzUri.getScheme();
+            getLogger().debug( "Scheme - " + scheme );
+            if ( scheme == null || !( scheme.equalsIgnoreCase( "http" ) || scheme.equalsIgnoreCase( "https" ) ) )
+            {
+                throw new ScmRepositoryException( "Jazz Url \"" + jazzUrl
+                    + "\" is not a valid URL. The Jazz Url syntax is " + JAZZ_URL_FORMAT );
+            }
+        }
+        catch ( IllegalArgumentException e )
+        {
+            throw new ScmRepositoryException( "Jazz Url \"" + jazzUrl
+                + "\" is not a valid URL. The Jazz Url syntax is " + JAZZ_URL_FORMAT );
+        }
+
+        // At this point, jazzUrl is guaranteed to start with either http:// or https://
+        // Further process the jazzUrl to extract the server name and port.
+        String hostname = null;
+        int port = 0;
+
+        if (havePort)
+        {
+            // jazzUrlAndWorkspace should be: http[s]://server_name:port/contextRoot:repositoryWorkspace
+            // jazzUrl should be            : http[s]://server_name:port/contextRoot
+            int protocolIndex = jazzUrl.indexOf( ":" ) + 3;     // The +3 accounts for the "://"
+            int portIndex = jazzUrl.indexOf( ":", protocolIndex + 1 );
+            hostname = jazzUrl.substring( protocolIndex, portIndex );
+            int pathIndex = jazzUrl.indexOf( "/", portIndex + 1 );
+            String portNo = jazzUrl.substring( portIndex + 1, pathIndex );
+            try
+            {
+                port = Integer.parseInt( portNo );
+            }
+            catch (NumberFormatException nfe)
+            {
+                throw new ScmRepositoryException( "Jazz Url \"" + jazzUrl
+                                                  + "\" is not a valid URL. The Jazz Url syntax is " + JAZZ_URL_FORMAT );
+            }
+        }
+        else
+        {
+            // jazzUrlAndWorkspace should be: http[s]://server_name/contextRoot:repositoryWorkspace
+            // jazzUrl should be            : http[s]://server_name/contextRoot
+            // So we will set port to zero.
+            int protocolIndex = jazzUrl.indexOf( ":" ) + 3;     // The +3 accounts for the "://"
+            int pathIndex = jazzUrl.indexOf( "/", protocolIndex + 1 );
+            if ( (protocolIndex != -1) && (pathIndex != -1) )
+            {
+                hostname = jazzUrl.substring( protocolIndex, pathIndex );
+            }
+            else
+            {
+                throw new ScmRepositoryException( "Jazz Url \"" + jazzUrl
+                                                  + "\" is not a valid URL. The Jazz Url syntax is " + JAZZ_URL_FORMAT );
+            }
+        }
+
+        getLogger().debug( "Creating JazzScmProviderRepository with the following values:" );
+        getLogger().debug( "jazzUrl             - " + jazzUrl );
+        getLogger().debug( "username            - " + username );
+        getLogger().debug( "password            - " + password );
+        getLogger().debug( "hostname            - " + hostname );
+        getLogger().debug( "port                - " + port );
+        getLogger().debug( "repositoryWorkspace - " + repositoryWorkspace );
+        
+        return new JazzScmProviderRepository( jazzUrl, username, password, hostname, port, repositoryWorkspace );
+    }
+
+    /** {@inheritDoc} */
+    public AddScmResult add( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzAddCommand command = new JazzAddCommand();
+        command.setLogger( getLogger() );
+        return (AddScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected BranchScmResult branch( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzBranchCommand command = new JazzBranchCommand();
+        command.setLogger( getLogger() );
+        return (BranchScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected BlameScmResult blame( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzBlameCommand command = new JazzBlameCommand();
+        command.setLogger( getLogger() );
+        return (BlameScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet,
+                                            CommandParameters parameters )
+        throws ScmException
+    {
+        // We need to call the status command first, so that we can get the details of the workspace.
+        // This is needed for the list changesets command.
+        // We could also 'trust' the value in the pom.
+        JazzStatusCommand statusCommand = new JazzStatusCommand();
+        statusCommand.setLogger( getLogger() );
+        statusCommand.execute( repository, fileSet, parameters );
+
+        JazzChangeLogCommand command = new JazzChangeLogCommand();
+        command.setLogger( getLogger() );
+        return (ChangeLogScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet,
+                                        CommandParameters parameters )
+        throws ScmException
+    {
+        JazzCheckInCommand command = new JazzCheckInCommand();
+        command.setLogger( getLogger() );
+        return (CheckInScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet,
+                                          CommandParameters parameters )
+        throws ScmException
+    {
+        JazzCheckOutCommand command = new JazzCheckOutCommand();
+        command.setLogger( getLogger() );
+        return (CheckOutScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected DiffScmResult diff( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzDiffCommand command = new JazzDiffCommand();
+        command.setLogger( getLogger() );
+        return (DiffScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzEditCommand command = new JazzEditCommand();
+        command.setLogger( getLogger() );
+        return (EditScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected ExportScmResult export( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        // Use checkout instead
+        return super.export( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected ListScmResult list( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        // We need to call the status command first, so that we can get the details of the stream etc.
+        // This is needed for workspace deliveries and snapshot promotions.
+        JazzStatusCommand statusCommand = new JazzStatusCommand();
+        statusCommand.setLogger( getLogger() );
+        statusCommand.execute( repository, fileSet, parameters );
+
+        JazzListCommand command = new JazzListCommand();
+        command.setLogger( getLogger() );
+        return (ListScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzStatusCommand command = new JazzStatusCommand();
+        command.setLogger( getLogger() );
+        return (StatusScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        // We need to call the status command first, so that we can get the details of the stream etc.
+        // This is needed for workspace deliveries and snapshot promotions.
+        JazzStatusCommand statusCommand = new JazzStatusCommand();
+        statusCommand.setLogger( getLogger() );
+        statusCommand.execute( repository, fileSet, parameters );
+
+        JazzTagCommand command = new JazzTagCommand();
+        command.setLogger( getLogger() );
+        return (TagScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzUpdateCommand command = new JazzUpdateCommand();
+        command.setLogger( getLogger() );
+        return (UpdateScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    protected UnEditScmResult unedit( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
+        throws ScmException
+    {
+        JazzUnEditCommand command = new JazzUnEditCommand();
+        command.setLogger( getLogger() );
+        return (UnEditScmResult) command.execute( repository, fileSet, parameters );
+    }
+
+    /** {@inheritDoc} */
+    public String getScmSpecificFilename()
+    {
+        return JazzConstants.SCM_META_DATA_FOLDER;
+    }
+
+}
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/JazzScmProvider.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java Mon Apr 23 07:45:33 2012
@@ -0,0 +1,259 @@
+package org.apache.maven.scm.provider.jazz.command;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author <a href="mailto:ChrisGWarp@gmail.com">Chris Graham</a>
+ */
+public class JazzConstants
+{
+    // -------------------------------------------------------------------------------------------------
+    // MISC.
+    // -------------------------------------------------------------------------------------------------
+
+    /**
+     * Executable for Jazz SCM (Rational Team Concert).
+     */
+    public static final String SCM_EXECUTABLE = "scm";
+
+    /**
+     * Folder created by the SCM to store metadata.
+     */
+    public static final String SCM_META_DATA_FOLDER = ".jazz5";
+
+    /**
+     * SCM type identifier
+     */
+    public static final String SCM_TYPE = "jazz";
+
+    // -------------------------------------------------------------------------------------------------
+    // COMMANDS
+    // -------------------------------------------------------------------------------------------------
+
+    /**
+     * Accept command - Accept change sets into a repository workspace and load them into the local workspace.
+     */
+    public static final String CMD_ACCEPT = "accept";
+
+    /**
+     * Annotate command - Show line-by-line revision information for a file.
+     */
+    public static final String CMD_ANNOTATE = "annotate";
+
+    /**
+     * Checkin command - Check in locally modified files, adding them to the current change set.
+     */
+    public static final String CMD_CHECKIN = "checkin";
+
+    /**
+     * Create command - Can be used with a sub command to create a snapshot (tag) or repository workspace (branch).
+     */
+    public static final String CMD_CREATE = "create";
+
+    /**
+     * Deliver command - Deliver to a target.
+     */
+    public static final String CMD_DELIVER = "deliver";
+    
+    /**
+     * Diff command - Compare two states of a file.
+     */
+    public static final String CMD_DIFF = "diff";
+
+    /**
+     * History command - Show the history of a file or component.
+     */
+    public static final String CMD_HISTORY = "history";
+
+    /**
+     * List command - List repository objects.
+     */
+    public static final String CMD_LIST = "list";
+
+    /**
+     * Load command - Load components from a repository workspace into a local workspace.
+     */
+    public static final String CMD_LOAD = "load";
+
+    /**
+     * Lock command - Used to lock or revoke locks on files in a stream. (requires 'acquire' or 'release' sub commands).
+     */
+    public static final String CMD_LOCK = "lock";
+
+    /**
+     * Snapshot command - Used to promote snapshots. Requires the 'promote' sub command.
+     */
+    public static final String CMD_SNAPSHOT = "snapshot";
+
+    /**
+     * Status command - Show modification status of items in a workspace.
+     */
+    public static final String CMD_STATUS = "status";
+
+    // -------------------------------------------------------------------------------------------------
+    // SUB-COMMANDS
+    // -------------------------------------------------------------------------------------------------
+
+    // CREATE sub commands
+    /**
+     * The 'type' (snapshot) of the create command.
+     */
+    public static final String CMD_SUB_SNAPSHOT = "snapshot";
+
+    /**
+     * The 'type' (workspace) of the create command.
+     */
+    public static final String CMD_SUB_WORKSPACE = "workspace";
+
+    /**
+     * The 'type' (changeset) of the create command.
+     */
+    public static final String CMD_SUB_CHANGESET = "changeset";
+
+    // LIST sub commands
+    /**
+     * List files in a remote workspace.
+     */
+    public static final String CMD_SUB_REMOTEFILES = "remotefiles";
+
+    /**
+     * List files in a remote workspace.
+     */
+    public static final String CMD_SUB_CHANGESETS = "changesets";
+
+    // LOCK sub commands
+    /**
+     * Locks files in a stream.
+     */
+    public static final String CMD_SUB_ACQUIRE = "acquire";
+
+    /**
+     * Revoke locks on files in a stream.
+     */
+    public static final String CMD_SUB_RELEASE = "release";
+
+    // SNAPSHOT sub commands
+    /**
+     * Promotes a snapshot to a stream or workspace.
+     */
+    public static final String CMD_SUB_PROMOTE = "promote";
+
+    // -------------------------------------------------------------------------------------------------
+    // ARGUMENTS
+    // -------------------------------------------------------------------------------------------------
+
+    /**
+     * Accept component additions and deletions (used with "accept" command).
+     */
+    public static final String ARG_FLOW_COMPONENTS = "--flow-components";
+
+    /**
+     * Overwrite existing files when loading (used with "load" command).
+     */
+    public static final String ARG_FORCE = "--force";
+
+    /**
+     * Local workspace path.
+     */
+    public static final String ARG_LOCAL_WORKSPACE_PATH = "--dir";
+
+    /**
+     * Load Root Directory.
+     */
+    public static final String ARG_LOAD_ROOT_DIRECTORY = "--directory";
+
+    /**
+     * The repository name.
+     */
+    public static final String ARG_REPOSITORY_URI = "--repository-uri";
+
+    /**
+     * Description for the snapshot (used with "create snapshot" command).
+     */
+    public static final String ARG_SNAPSHOT_DESCRIPTION = "--description";
+
+    /**
+     * Name of the snapshot (used with "create snapshot" command).
+     */
+    public static final String ARG_SNAPSHOT_NAME = "--name";
+
+    /**
+     * Forces the output to not shorten, otherwise the width will be based on the COLUMNS environment variable, or if
+     * that is not set, to 80 characters. (used with the "status" command).
+     */
+    public static final String ARG_STATUS_WIDE_PRINT_OUT = "--wide";
+
+    /**
+     * The user ID in the repository.
+     */
+    public static final String ARG_USER_NAME = "--username";
+
+    /**
+     * The user password in the repository.
+     */
+    public static final String ARG_USER_PASSWORD = "--password";
+
+    /**
+     * Description for the repository workspace (used with "create workspace" command).
+     */
+    public static final String ARG_WORKSPACE_DESCRIPTION = "--description";
+
+    /**
+     * Name of the repository workspace (used with "create workspace" command).
+     */
+    public static final String ARG_WORKSPACE_NAME = "--name";
+
+    /**
+     * Name of the repository workspace (used with "create workspace" command).
+     */
+    public static final String ARG_WORKSPACE_SNAPSHOT = "--snapshot";
+
+    /**
+     * Name of the source repository workspace (used with "deliver" command).
+     */
+    public static final String ARG_DELIVER_SOURCE = "--source";
+
+    /**
+     * Name of the target repository workspace or stream (used with "deliver" command).
+     */
+    public static final String ARG_DELIVER_TARGET = "--target";
+
+    /**
+     * Ignore uncommitted changes and deliver (used with "deliver" command).
+     */
+    public static final String ARG_OVERWRITE_UNCOMMITTED = "--overwrite-uncommitted";
+
+    /**
+     * Perform a file base diff (aftertype = file) (used with "diff" command).
+     */
+    public static final String ARG_FILE = "file";
+
+    /**
+     * Specify the maximum number of results to return, must be greater than zero.
+     * Used by numerous commands.
+     */
+    public static final String ARG_MAXIMUM = "--maximum";
+
+    /**
+     * Name of the repository workspace (used with "list changesets" command).
+     */
+    public static final String ARG_WORKSPACE = "--workspace";
+    
+}
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzConstants.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java Mon Apr 23 07:45:33 2012
@@ -0,0 +1,264 @@
+package org.apache.maven.scm.provider.jazz.command;
+
+/*
+ * 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.io.File;
+import java.util.Iterator;
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer;
+import org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository;
+import org.codehaus.plexus.util.Os;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.cli.CommandLineException;
+import org.codehaus.plexus.util.cli.CommandLineUtils;
+import org.codehaus.plexus.util.cli.Commandline;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * The base class for the underlying jazz "scm.sh"/"scm.exe" command.
+ * 
+ * The SCM command is documented here:
+ * 
+ * V2.0.2: http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
+ * V3.0:   http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
+ * V3.0.1: http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.scm.doc/topics/r_scm_cli_scm.html
+ * 
+ * @author <a href="mailto:ChrisGWarp@gmail.com">Chris Graham</a>
+ */
+public class JazzScmCommand
+{
+    // The logger to use.
+    private ScmLogger fLogger;
+
+    // The Commandline that we build up and execute.
+    private Commandline fCommand;
+
+    /**
+     * Create a JazzScmCommand when no sub-command is needed.
+     * @throws ScmException 
+     */
+    public JazzScmCommand( String cmd, ScmProviderRepository repo, ScmFileSet fileSet, ScmLogger logger )
+    {
+        this( cmd, null, repo, true, fileSet, logger );
+    }
+
+    /**
+     * Create a JazzScmCommand when a sub-command is needed.
+     * eg: "create snapshot ..."
+     */
+    public JazzScmCommand( String cmd, String subCmd, ScmProviderRepository repo, ScmFileSet fileSet, ScmLogger logger )
+    {
+        this( cmd, subCmd, repo, true, fileSet, logger );
+    }
+
+    /**
+     * Create a JazzScmCommand, adding the repository-uri as needed.
+     */
+    public JazzScmCommand( String cmd, String subCmd, ScmProviderRepository repo, boolean addRepositoryWorkspaceArg,
+                           ScmFileSet fileSet, ScmLogger logger )
+    {
+        fLogger = logger;
+        fCommand = new Commandline();
+
+        // TODO This was developed and tested in Windows (in which scm (scm.exe) was the valid executable)
+        // Verify that the executable is valid in other operating systems.
+        fCommand.setExecutable( JazzConstants.SCM_EXECUTABLE );
+
+        if ( fileSet != null )
+        {
+            fCommand.setWorkingDirectory( fileSet.getBasedir().getAbsolutePath() );
+
+            // Make the directory, if need be.
+            if ( !fCommand.getWorkingDirectory().exists() )
+            {
+                boolean success = fCommand.getWorkingDirectory().mkdirs();
+                if ( !success )
+                {
+                    // Just log the error, don't throw an error, as it is going to fail anyway.
+                    logErrorMessage( "Working directory did not exist" + " and it couldn't be created: " + fCommand.getWorkingDirectory() );
+                }
+            }
+        }
+
+        // Add the main command
+        if ( !StringUtils.isEmpty( cmd ) )
+        {
+            addArgument( cmd );
+        }
+
+        // Add the sub-command if present
+        if ( !StringUtils.isEmpty( subCmd ) )
+        {
+            addArgument( subCmd );
+        }
+
+        JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
+
+        // Add the repository argument if needed (most commands need this, but not all)
+        if ( addRepositoryWorkspaceArg )
+        {
+            String repositoryWorkspace = jazzRepo.getRepositoryURI();
+            if ( !StringUtils.isEmpty( repositoryWorkspace ) )
+            {
+                addArgument( JazzConstants.ARG_REPOSITORY_URI );
+                addArgument( jazzRepo.getRepositoryURI() );
+            }
+        }
+
+        // Add the username argument
+        // TODO Figure out how we would use the login command / username caching so this is not required on each
+        // command.
+        String user = jazzRepo.getUser();
+        if ( !StringUtils.isEmpty( user ) )
+        {
+            addArgument( JazzConstants.ARG_USER_NAME );
+            addArgument( jazzRepo.getUser() );
+        }
+
+        // Add the password argument
+        // TODO Figure out how we would use the login command / password caching so this is not required on each
+        // command.
+        String password = jazzRepo.getPassword();
+        if ( !StringUtils.isEmpty( password ) )
+        {
+            addArgument( JazzConstants.ARG_USER_PASSWORD );
+            addArgument( jazzRepo.getPassword() );
+        }
+    }
+
+    public void addArgument( ScmFileSet fileSet )
+    {
+        logInfoMessage( "files: " + fileSet.getBasedir().getAbsolutePath() );
+        Iterator<File> iter = fileSet.getFileList().iterator();
+        while ( iter.hasNext() )
+        {
+            fCommand.createArg().setValue( ( (File) iter.next() ).getPath() );
+        }
+    }
+
+    public void addArgument( String arg )
+    {
+        fCommand.createArg().setValue( arg );
+    }
+
+    public int execute( StreamConsumer out, ErrorConsumer err )
+        throws ScmException
+    {
+        logInfoMessage( "Executing: " + cryptPassword( fCommand ) );
+        if ( fCommand.getWorkingDirectory() != null )
+        {
+            logInfoMessage( "Working directory: " + fCommand.getWorkingDirectory().getAbsolutePath() );
+        }
+
+        int status = 0;
+        try
+        {
+            status = CommandLineUtils.executeCommandLine( fCommand, out, err );
+        }
+        catch ( CommandLineException e )
+        {
+            String errorOutput = err.getOutput();
+            if (errorOutput.length() > 0)
+            {
+                logErrorMessage( "Error: " + err.getOutput() );
+            }
+            throw new ScmException( "Error while executing Jazz SCM command line - " + getCommandString(), e );
+        }
+        String errorOutput = err.getOutput();
+        if (errorOutput.length() > 0)
+        {
+            logErrorMessage( "Error: " + err.getOutput() );
+        }
+        return status;
+    }
+
+    public String getCommandString()
+    {
+        return fCommand.toString();
+    }
+
+    public Commandline getCommandline()
+    {
+        return fCommand;
+    }
+
+    private void logErrorMessage( String message )
+    {
+        if ( fLogger != null )
+        {
+            fLogger.error( message );
+        }
+    }
+
+    private void logInfoMessage( String message )
+    {
+        if ( fLogger != null )
+        {
+            fLogger.info( message );
+        }
+    }
+
+    private void logDebugMessage( String message )
+    {
+        if ( fLogger != null )
+        {
+            fLogger.debug( message );
+        }
+    }
+
+    // Unashamedly 'borrowed' from SvnCommandLineUtils
+    // (but fixed for cases where the line ends in the password (no trailing space or further input).
+    public static String cryptPassword( Commandline cl )
+    {
+        String clString = cl.toString();
+        
+        int pos = clString.indexOf( "--password" );
+
+        if ( pos > 0 )
+        {
+            String beforePassword = clString.substring( 0, pos + "--password ".length() );
+            String afterPassword = clString.substring( pos + "--password ".length() );
+            pos = afterPassword.indexOf( ' ' );
+            if (pos > 0)
+            {
+                afterPassword = afterPassword.substring( pos );
+            }
+            else
+            {
+                afterPassword = "\"";
+            }
+            if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
+            {
+                clString = beforePassword + "*****" + afterPassword;
+            }
+            else
+            {
+                clString = beforePassword + "'*****'" + afterPassword;
+            }
+        }
+
+        return clString;
+    }
+    
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/JazzScmCommand.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java Mon Apr 23 07:45:33 2012
@@ -0,0 +1,209 @@
+package org.apache.maven.scm.provider.jazz.command.add;
+
+/*
+ * 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.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.ScmResult;
+import org.apache.maven.scm.command.add.AbstractAddCommand;
+import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.status.StatusScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.jazz.command.JazzConstants;
+import org.apache.maven.scm.provider.jazz.command.JazzScmCommand;
+import org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer;
+import org.apache.maven.scm.provider.jazz.command.status.JazzStatusCommand;
+
+// RTC does not have the equivalent of the "add" goal. The closest we have is the "share" command, however
+// that only shares directories (not individual or specific files), and it is recursive (which can not be
+// switched off!).
+//
+// The Maven SCM plugin "add" goal's job is to add files to source control, but not commit them.
+// The SVN equivalent of this is "svn add", which places a file under source control (Working Copy in svn terms)
+// but does not commit them (svn commit).
+// So, this provider will use the RTC "checkin" command for the implementation of the "add" goal.
+// This will checkin the code into a remote repository workspace. It will not deliver.
+//
+// Additionally, "svn add" does not take a message, whereas commit does. Under RTC, the only way we can preserve
+// the message, is to create a changeset. So we do that in the "checkin" goal, not the "add" goal.
+// 
+// The Maven SCM plugin "add" goal is roughly equivalent to the RTC "checkin" command.
+//
+// See the following links for additional information on the RTC "checkin" command.
+// RTC 2.0.0.2:
+// http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_checkin.html
+// RTC 3.0:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_checkin.html
+// RTC 3.0.1:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.scm.doc/topics/r_scm_cli_checkin.html
+//
+// Currently this implementation does not use the comment message.
+// Perhaps in the future this method can be used to deliver a change-set with the given comment message.
+// However some users may want the checkin goal to only check in to the desired repository workspace.
+// While some users may want the checkin goal to both check in to the desired repository workspace and deliver it to a
+// stream.
+// Currently this implementation only checks in the unresolved changes to the repository workspace.
+//
+// See the following links for additional information on the RTC "deliver" command.
+// RTC 2.0.0.2:
+// http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_deliver.html
+// RTC 3.0:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_deliver.html
+// RTC 3.0.1:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.scm.doc/topics/r_scm_cli_deliver.html
+//
+
+/**
+ * @author <a href="mailto:ChrisGWarp@gmail.com">Chris Graham</a>
+ */
+public class JazzAddCommand
+    extends AbstractAddCommand
+{
+    /**
+     * {@inheritDoc}
+     */
+    protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message,
+                                           boolean binary )
+        throws ScmException
+    {
+        if ( getLogger().isDebugEnabled() )
+        {
+            getLogger().debug( "Executing add command..." );
+        }
+
+        // The message can only be used when we create a change set, which is only done on the checkin command.
+        // So that can be ignored.
+        // The binary flag, is not needed for RTC.
+        return executeAddCommand( repo, fileSet );
+    }
+
+    public AddScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet )
+        throws ScmException
+    {
+        // NOTE: THIS IS ALSO CALLED DIRECTLY FROM THE CHECKIN COMMAND.
+        //
+        // The "checkin" command does not produce consumable output as to which individual files were checked in. (in
+        // 2.0.0.2 at least). Since only "locally modified" changes get checked in, we call a "status" command to
+        // generate a list of these files.
+        File baseDir = fileSet.getBasedir();
+        File parentFolder = ( baseDir.getParentFile() != null ) ? baseDir.getParentFile() : baseDir;
+
+        List<ScmFile> changedScmFiles = new ArrayList<ScmFile>();
+        List<File> changedFiles = new ArrayList<File>();
+        List<ScmFile> commitedFiles = new ArrayList<ScmFile>();
+
+        JazzStatusCommand statusCmd = new JazzStatusCommand();
+        statusCmd.setLogger( getLogger() );
+        StatusScmResult statusCmdResult = statusCmd.executeStatusCommand( repo, fileSet );
+        List<ScmFile> statusScmFiles = statusCmdResult.getChangedFiles();
+
+        for ( Iterator<ScmFile> it = statusScmFiles.iterator(); it.hasNext(); )
+        {
+            ScmFile file = (ScmFile) it.next();
+            getLogger().debug( "Iterating over statusScmFiles: " + file );
+            if ( file.getStatus() == ScmFileStatus.ADDED ||
+                 file.getStatus() == ScmFileStatus.DELETED ||
+                 file.getStatus() == ScmFileStatus.MODIFIED )
+            {
+                changedScmFiles.add( new ScmFile( file.getPath(), ScmFileStatus.CHECKED_IN ) );
+                changedFiles.add( new File( parentFolder, file.getPath() ) );
+            }
+        }
+
+        List<File> files = fileSet.getFileList();
+        if ( files.size() == 0 )
+        { 
+            // Either commit all local changes
+            commitedFiles = changedScmFiles;
+        }
+        else
+        { 
+            // Or commit specific files
+            for ( int i = 0; i < files.size(); i++ )
+            {
+                if ( fileExistsInFileList( (File) ( files.get( i ) ), changedFiles ) )
+                {
+                    commitedFiles.add( new ScmFile( ( (File) files.get( i ) ).getPath(), ScmFileStatus.CHECKED_IN ) );
+                }
+            }
+        }
+
+        // Now that we have a list of files to process, we can "add" (scm checkin) them.
+        JazzAddConsumer addConsumer = new JazzAddConsumer( repo, getLogger() );
+        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
+        JazzScmCommand command = createAddCommand( repo, fileSet );
+
+        int status = command.execute( addConsumer, errConsumer );
+        if ( status != 0 || errConsumer.hasBeenFed() )
+        {
+            return new AddScmResult( command.getCommandString(),
+                                     "Error code for Jazz SCM add (checkin) command - " + status,
+                                     errConsumer.getOutput(), false );
+        }
+
+        return new AddScmResult( command.getCommandString(), addConsumer.getFiles() );
+    }
+
+    public JazzScmCommand createAddCommand( ScmProviderRepository repo, ScmFileSet fileSet )
+    {
+        JazzScmCommand command =
+            new JazzScmCommand( JazzConstants.CMD_CHECKIN, null, repo, false, fileSet, getLogger() );
+
+        List<File> files = fileSet.getFileList();
+        if ( files != null && !files.isEmpty() )
+        {
+            Iterator<File> it = files.iterator();
+            while ( it.hasNext() )
+            {
+                File file = (File) it.next();
+                command.addArgument( file.getPath() ); // Check in only the files specified
+            }
+        }
+        else
+        {
+            command.addArgument( "." ); // This will check in all local changes
+        }
+
+        return command;
+    }
+
+    private boolean fileExistsInFileList( File file, List<File> fileList )
+    {
+        boolean exists = false;
+        for ( Iterator<File> it = fileList.iterator(); it.hasNext(); )
+        {
+            File changedFile = (File) it.next();
+            if ( changedFile.compareTo( file ) == 0 )
+            {
+                exists = true;
+                break;
+            }
+        }
+        return exists;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddCommand.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java Mon Apr 23 07:45:33 2012
@@ -0,0 +1,120 @@
+package org.apache.maven.scm.provider.jazz.command.add;
+
+/*
+ * 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.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.ScmFileStatus;
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.jazz.command.consumer.AbstractRepositoryConsumer;
+
+/**
+ * Consume the output of the scm command for the "add" operation.
+ * 
+ * @author <a href="mailto:ChrisGWarp@gmail.com">Chris Graham</a>
+ */
+public class JazzAddConsumer 
+    extends AbstractRepositoryConsumer
+{
+    // A flag to indicate that we have seen the "Changes:" line in the output.
+    // After that, we have the files themselves.
+    private boolean haveSeenChanges = false;
+
+    protected String fCurrentDir = "";
+
+    // The list of files that we have checked in.
+    private ArrayList<ScmFile> fCheckedInFiles = new ArrayList<ScmFile>();
+
+    /**
+     * Construct the JazzAddCommand consumer.
+     * @param repository The repository we are working with.
+     * @param logger The logger to use.
+     */
+    public JazzAddConsumer( ScmProviderRepository repository, ScmLogger logger )
+    {
+        super( repository, logger );
+    }
+
+    /**
+     * Process one line of output from the execution of the "scm xxxx" command.
+     * @param line The line of output from the external command that has been pumped to us.
+     * @see org.codehaus.plexus.util.cli.StreamConsumer#consumeLine(java.lang.String)
+     */
+    public void consumeLine( String line )
+    {
+        super.consumeLine( line );
+        // The Jazz SCM "checkin" command does not output a list of each file that was checked in.
+        // An example output is shown below, perhaps in the future we may need to
+        // consume the "Workspace", "Component", Stream or "Change sets"
+
+        /*
+            Committing...
+            Workspace: (1004) "Release Repository Workspace" <-> (1005) "Maven Release Plugin Stream"
+              Component: (1006) "Release Component"
+                Outgoing:
+                  Change sets:
+                    (1008) --@ <No comment>
+                    
+        Or:
+        
+            Committing...
+            Workspace: (1903) "MavenSCMTestWorkspace_1332908068770" <-> (1903) "MavenSCMTestWorkspace_1332908068770"
+              Component: (1768) "MavenSCMTestComponent"
+                Outgoing:
+                  Change sets:
+                    (1907)  *--@  "Commit message"
+                      Changes:
+                        --a-- \src\main\java\Me.java
+                        --a-- \src\main\java\Me1.java
+                        --a-- \src\main\java\Me2.java        
+        */
+
+        if ( haveSeenChanges )
+        {
+            // We have already seen the "Changes:" line, so we must now be processing files.
+            String trimmed = line.trim();
+            int spacePos = trimmed.indexOf( " " );
+            // NOTE: The second + 1 is to remove the leading slash
+            String path = trimmed.substring( spacePos + 1 + 1 );
+            fCheckedInFiles.add( new ScmFile( path, ScmFileStatus.CHECKED_OUT ) );
+        }
+        else
+        {
+            if ( "Changes:".equals(line.trim()) )
+            {
+                haveSeenChanges = true;
+            }
+        }
+    }
+
+    protected ScmFile getScmFile( String filename )
+    {
+        return new ScmFile( new File( fCurrentDir, filename ).getAbsolutePath(), ScmFileStatus.CHECKED_OUT );
+    }
+
+    public List<ScmFile> getFiles()
+    {
+        return fCheckedInFiles;
+    }
+}
\ No newline at end of file

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/add/JazzAddConsumer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java?rev=1329106&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java (added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java Mon Apr 23 07:45:33 2012
@@ -0,0 +1,93 @@
+package org.apache.maven.scm.provider.jazz.command.blame;
+
+/*
+ * 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 org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.blame.AbstractBlameCommand;
+import org.apache.maven.scm.command.blame.BlameScmResult;
+import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.provider.jazz.command.JazzConstants;
+import org.apache.maven.scm.provider.jazz.command.JazzScmCommand;
+import org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer;
+
+// The Maven SCM plugin "blame" goal is equivalent to the RTC "annotate" command.
+//
+// See the following links for additional information on the RTC "annotate" command:
+// RTC 2.0.0.2:
+// http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_annotate.html
+// RTC 3.0:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_annotate.html
+// RTC 3.0.1:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.scm.doc/topics/r_scm_cli_annotate.html
+//
+// The RTC "history" command also provides similar information that might be needed for the "blame" goal.
+// See the following links for additional information on the RTC "history" command:
+// RTC 2.0.0.2:
+// http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_history.html
+// RTC 3.0:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0/topic/com.ibm.team.scm.doc/topics/r_scm_cli_history.html
+// RTC 3.0.1:
+// http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.team.scm.doc/topics/r_scm_cli_history.html
+//
+
+/**
+ * @author <a href="mailto:ChrisGWarp@gmail.com">Chris Graham</a>
+ */
+public class JazzBlameCommand
+    extends AbstractBlameCommand
+{
+    /**
+     * {@inheritDoc}
+     */
+    public BlameScmResult executeBlameCommand( ScmProviderRepository repo, ScmFileSet fileSet, String filename )
+        throws ScmException
+    {
+        if ( getLogger().isDebugEnabled() )
+        {
+            getLogger().debug( "Executing blame command..." );
+        }
+
+        JazzScmCommand blameCmd = createBlameCommand( repo, fileSet, filename );
+
+        JazzBlameConsumer blameConsumer = new JazzBlameConsumer(repo, getLogger());
+        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
+
+        int status = blameCmd.execute( blameConsumer, errConsumer );
+        if ( status != 0 || errConsumer.hasBeenFed() )
+        {
+            return new BlameScmResult( blameCmd.getCommandString(),
+                                       "Error code for Jazz SCM blame command - " + status,
+                                       errConsumer.getOutput(), false );
+        }
+
+        return new BlameScmResult( blameCmd.getCommandString(), blameConsumer.getLines() );
+    }
+
+    public JazzScmCommand createBlameCommand( ScmProviderRepository repo, ScmFileSet fileSet, String filename )
+    {
+        JazzScmCommand command =
+            new JazzScmCommand( JazzConstants.CMD_ANNOTATE, null, repo, false, fileSet, getLogger() );
+        command.addArgument( filename );
+
+        return command;
+    }
+
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-jazz/src/main/java/org/apache/maven/scm/provider/jazz/command/blame/JazzBlameCommand.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message