Author: brett
Date: Thu Jun  9 23:20:28 2005
New Revision: 189906

URL: http://svn.apache.org/viewcvs?rev=189906&view=rev
Log:
PR: MPSCM-56
Submitted by: Dan Tran
Add Starteam support, plus scm:add, scm:status, scm:checkin

Added:
    
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java
   (with props)
    
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java
   (with props)
Modified:
    maven/maven-1/plugins/trunk/scm/   (props changed)
    maven/maven-1/plugins/trunk/scm/plugin.jelly
    maven/maven-1/plugins/trunk/scm/plugin.properties
    maven/maven-1/plugins/trunk/scm/project.xml
    
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmBean.java
    maven/maven-1/plugins/trunk/scm/xdocs/goals.xml
    maven/maven-1/plugins/trunk/scm/xdocs/properties.xml
    maven/maven-1/plugins/trunk/scm/xdocs/scmurl.xml

Propchange: maven/maven-1/plugins/trunk/scm/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Thu Jun  9 23:20:28 2005
@@ -1,3 +1,4 @@
 target
 *.log
 maven-scm-plugin.iml
+project.xml.backup

Modified: maven/maven-1/plugins/trunk/scm/plugin.jelly
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/plugin.jelly?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/scm/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/scm/plugin.jelly Thu Jun  9 23:20:28 2005
@@ -38,7 +38,7 @@
     <define:jellybean
        name="update"
        method="update"     
-       className="org.apache.maven.plugins.scm.ScmBean"
+       className="org.apache.maven.plugins.scm.ScmUpdateBean"
     />
     <define:jellybean
        name="tag"
@@ -60,6 +60,12 @@
        method="diff"     
        className="org.apache.maven.plugins.scm.ScmDiffBean"
     />
+    <define:jellybean
+       name="add"
+       method="add"     
+       className="org.apache.maven.plugins.scm.ScmAddBean"
+    />
+    
   </define:taglib>
 
   <goal name="scm:find-connection">
@@ -125,10 +131,21 @@
   </goal>
 
   <goal name="scm:update" prereqs="scm:find-connection" description="Update 
the project in the current directory from SCM">
+
     <ant:echo>Updating from SCM</ant:echo>
 
-    <!-- Connection may not be used, but is needed for correct operation of 
Maven SCM at this point and for the tag in SVN if that were implemented -->
-    <scm:update url="${scmConnection}" workingDirectory="${basedir}" 
username="${maven.scm.username}" password="${maven.scm.password}" />
+    <j:if test="${scmConnection == null}">
+      <ant:fail>You must specify an SCM URL to connect to</ant:fail>
+    </j:if>
+
+    <scm:update 
+        url="${scmConnection}" 
+        workingDirectory="${basedir}" 
+        includes="${maven.scm.src.includes}"
+        excludes="${maven.scm.src.excludes}"
+        username="${maven.scm.username}" 
+        password="${maven.scm.password}" />
+        
   </goal>
 
   <goal name="scm:tag" prereqs="scm:find-connection" description="Tag the 
project in the current directory in SCM">
@@ -145,6 +162,60 @@
     <scm:tag url="${scmConnection}" workingDirectory="${basedir}" 
tag="${maven.scm.tag}" tagBase="${maven.scm.svn.tag.base}" 
username="${maven.scm.username}" password="${maven.scm.password}" />
   </goal>
 
+  <goal name="scm:checkin" prereqs="scm:find-connection" description="Checkin 
a set of files in the current directory of SCM" >
+  
+    <ant:echo>Checkin files to SCM</ant:echo>
+
+    <j:if test="${scmConnection == null}">
+      <ant:fail>You must specify an SCM URL to connect to</ant:fail>
+    </j:if>
+
+    <scm:checkin 
+      url="${scmConnection}" 
+      workingDirectory="${basedir}" 
+      username="${maven.scm.username}" 
+      password="${maven.scm.password}" 
+      excludes="${maven.scm.src.excludes}" 
+      includes="${maven.scm.src.includes}" 
+      message="${maven.scm.message}" 
+      tag="${maven.scm.tag}" />
+    
+  </goal>
+
+  <goal name="scm:add" prereqs="scm:find-connection" description="Add a set of 
files in the current directory of SCM" >
+
+    <ant:echo>Add files to SCM</ant:echo>
+
+    <j:if test="${scmConnection == null}">
+      <ant:fail>You must specify an SCM URL to connect to</ant:fail>
+    </j:if>
+
+    <scm:add
+      url="${scmConnection}" 
+      workingDirectory="${basedir}" 
+      username="${maven.scm.username}" 
+      password="${maven.scm.password}" 
+      excludes="${maven.scm.src.excludes}" 
+      includes="${maven.scm.src.includes}"  />
+    
+  </goal>
+
+  <goal name="scm:status" prereqs="scm:find-connection" description="Query for 
status in the current directory of SCM" >
+
+    <ant:echo>Query for status</ant:echo>
+
+    <j:if test="${scmConnection == null}">
+      <ant:fail>You must specify an SCM URL to connect to</ant:fail>
+    </j:if>
+
+    <scm:status
+      url="${scmConnection}" 
+      workingDirectory="${basedir}" 
+      username="${maven.scm.username}" 
+      password="${maven.scm.password}" />
+    
+  </goal>
+  
   <!-- TODO: change prereqs to scm:find-connection only -->
   <goal name="scm:perform-release" 
prereqs="scm:parse-connection,scm:check-deprecated-cvs-vars"
     description="Perform a release from SCM">

Modified: maven/maven-1/plugins/trunk/scm/plugin.properties
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/plugin.properties?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/scm/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/scm/plugin.properties Thu Jun  9 23:20:28 2005
@@ -41,6 +41,13 @@
 # check whether CVS tagged first, and warn
 maven.scm.check.tagged=true
 
+# settings for scm:checkin, scm:add
+maven.scm.src.includes=
+maven.scm.src.excludes=
+
+#specific to scm:checkin
+maven.scm.message=
+
 #===============
 # CVS Properties
 #===============

Modified: maven/maven-1/plugins/trunk/scm/project.xml
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/project.xml?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/scm/project.xml (original)
+++ maven/maven-1/plugins/trunk/scm/project.xml Thu Jun  9 23:20:28 2005
@@ -22,7 +22,7 @@
   <extend>../plugin-parent/project.xml</extend>
   <id>maven-scm-plugin</id>
   <name>Maven Source Control Management Plug-in</name>
-  <currentVersion>1.5</currentVersion>
+  <currentVersion>1.5.1-SNAPSHOT</currentVersion>
   <description>A plugin for SCM tasks, currently CVS.</description>
   <shortDescription>SCM Plugin for Maven.</shortDescription>
   <url>http://maven.apache.org/reference/plugins/scm/</url>
@@ -124,17 +124,22 @@
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-api</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-2-20050610.043511-1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-cvs</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-2-20050610.043511-1</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-svn</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-2-20050610.054835-1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-starteam</artifactId>
+      <version>1.0-alpha-2-20050610.051724-1</version>
     </dependency>
   </dependencies>
 </project>

Added: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java?rev=189906&view=auto
==============================================================================
--- 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java
 (added)
+++ 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java
 Thu Jun  9 23:20:28 2005
@@ -0,0 +1,58 @@
+package org.apache.maven.plugins.scm;
+
+/* ====================================================================
+ *   Copyright 2001-2004 The Apache Software Foundation.
+ *
+ *   Licensed 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.ScmFileSet;
+import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.repository.ScmRepository;
+
+import java.io.File;
+
+/**
+ * A bean for using the Maven SCM API because wrangling objects in Jelly is no 
fun.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
+ */
+public class ScmAddBean extends ScmPatternBean
+{
+    private String message;
+
+    public void add()
+        throws Exception
+    {
+        ScmManager scmManager = lookupScmManager();
+
+        ScmRepository repository = getScmRepository( scmManager );
+
+        AddScmResult result = scmManager.add( repository,  new ScmFileSet( new 
File( getWorkingDirectory() ), getIncludes(), getExcludes() ) );
+        checkResult( result );
+    }
+
+    public void setMessage( String message )
+    {
+        this.message = message;
+    }
+
+    public String getMessage()
+    {
+        return message;
+    }
+
+}
+

Propchange: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmAddBean.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmBean.java
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmBean.java?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmBean.java
 (original)
+++ 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmBean.java
 Thu Jun  9 23:20:28 2005
@@ -20,6 +20,7 @@
 import org.apache.maven.scm.ScmFileSet;
 import org.apache.maven.scm.ScmResult;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import 
org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.command.tag.TagScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
@@ -119,6 +120,23 @@
                 svnRepo.setTagBase( tagBase );
             }
         }
+        
+        if ( repository.getProvider().equals( "starteam" ) )
+        {
+            StarteamScmProviderRepository starteamRepo = 
(StarteamScmProviderRepository) repository.getProviderRepository();
+
+  /* TODO: reinstate when the provider supports it
+            if ( username != null && username.length() > 0 )
+            {
+                starteamRepo.setUser( username );
+            }
+            if ( password != null && password.length() > 0 )
+            {
+                starteamRepo.setPassword( password );
+            }
+      */
+        }
+        
         return repository;
     }
 

Added: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java?rev=189906&view=auto
==============================================================================
--- 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java
 (added)
+++ 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java
 Thu Jun  9 23:20:28 2005
@@ -0,0 +1,50 @@
+package org.apache.maven.plugins.scm;
+
+/* ====================================================================
+ *   Copyright 2001-2004 The Apache Software Foundation.
+ *
+ *   Licensed 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.ScmFileSet;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.repository.ScmRepository;
+
+import java.io.File;
+
+/**
+ * A bean for using the Maven SCM API because wrangling objects in Jelly is no 
fun.
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
+ */
+public class ScmUpdateBean extends ScmPatternBean
+{
+    private String message;
+
+    public void update()
+        throws Exception
+    {
+        ScmManager scmManager = lookupScmManager();
+
+        ScmRepository repository = getScmRepository( scmManager );
+
+        UpdateScmResult result = scmManager.update( repository, 
+                                                    new ScmFileSet( new File( 
getWorkingDirectory() ), getIncludes(), getExcludes() ),
+                                                    getTag() );
+        checkResult( result );
+    }
+
+}
+

Propchange: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/maven-1/plugins/trunk/scm/src/main/org/apache/maven/plugins/scm/ScmUpdateBean.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/maven-1/plugins/trunk/scm/xdocs/goals.xml
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/xdocs/goals.xml?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/scm/xdocs/goals.xml (original)
+++ maven/maven-1/plugins/trunk/scm/xdocs/goals.xml Thu Jun  9 23:20:28 2005
@@ -33,8 +33,16 @@
         <description>Checkout a project</description>
       </goal>
       <goal>
+        <name>scm:checkin</name>
+        <description>Check in a list files</description>
+      </goal>
+      <goal>
         <name>scm:update</name>
         <description>Update a project from SCM</description>
+      </goal>
+      <goal>
+        <name>scm:add</name>
+        <description>Add new files into SCM</description>
       </goal>
       <goal>
         <name>scm:tag</name>

Modified: maven/maven-1/plugins/trunk/scm/xdocs/properties.xml
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/xdocs/properties.xml?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/scm/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/scm/xdocs/properties.xml Thu Jun  9 23:20:28 
2005
@@ -118,7 +118,7 @@
             <td>Yes</td>
             <td>
               <p>
-                The username to pass to the SCM. Currently only Subversion is 
known to honour this.
+                The username to pass to the SCM. Currently only Subversion and 
Starteam are known to honour this.
                 You can also add it to the URL, eg. <code>http://[EMAIL 
PROTECTED]/repos</code>.
               </p>
             </td>
@@ -128,12 +128,45 @@
             <td>Yes</td>
             <td>
               <p>
-                The password to give to the SCM. Currently only Subversion is 
known to honour this.
+                The password to give to the SCM. Currently only Subversion and 
Starteam are known to honour this.
                 It is not recommended that you use this property, and instead 
use an alternative authentication
                 technique such as an ssh agent or Subversion's password 
caching mechanism.
               </p>
             </td>
           </tr>
+          
+          <tr>
+            <td>maven.scm.message</td>
+            <td>Yes</td>
+            <td>
+              <p>
+                Add/Checkin comment. Default is blank.
+              </p>
+            </td>
+          </tr>
+          
+          <tr>
+            <td>maven.scm.src.includes</td>
+            <td>Yes</td>
+            <td>
+              <p>
+                Comma or space separated list of Ant path patterns for 
scm:checkin, scm:update, scm:add goals
+                Default is blank.
+              </p>
+            </td>
+          </tr>
+          <tr>
+            <td>maven.scm.src.excludes</td>
+            <td>Yes</td>
+            <td>
+              <p>
+                Comma or space separated list of Ant path patterns for 
scm:checkin, scm:update, scm:add goals
+                Default is blank.
+              </p>
+            </td>
+          </tr>
+
+          
         </table>
       </subsection>
       <subsection name="Subversion Specific Settings">

Modified: maven/maven-1/plugins/trunk/scm/xdocs/scmurl.xml
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/scm/xdocs/scmurl.xml?rev=189906&r1=189905&r2=189906&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/scm/xdocs/scmurl.xml (original)
+++ maven/maven-1/plugins/trunk/scm/xdocs/scmurl.xml Thu Jun  9 23:20:28 2005
@@ -64,7 +64,29 @@
 scm:svn:http://svn.apache.org/svn/root/module
 scm:cvs:https://[EMAIL PROTECTED]/svn/root/module</source>
       </subsection>
+    
+      <subsection name="StarTeam">
+        <p>
+          The full connection string for StarTeam is as follows:
+        </p>
+        <source>scm:starteam:username:[EMAIL 
PROTECTED]:endpoint/projectName/viewName/folderHierarchy</source>
+        <p>
+        <code>maven.scm.username</code> and <code>maven.scm.password</code>
+        are the prefer way to store authentication information.
+        </p>
+        <p>
+          For example:
+        </p>
+        <source>
+scm:starteam:username:[EMAIL PROTECTED]:23456/project/view/folder1/folder2
+scm:starteam:[EMAIL PROTECTED]:23456/project/view/folder
+scm:starteam:hostname:23456/project/view/folder
+        </source>
+      </subsection>
+      
     </section>
+
+    
   </body>
 </document>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to