maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r208653 - in /maven/scm/trunk: ./ maven-scm-plugin/ maven-scm-plugin/src/ maven-scm-plugin/src/main/ maven-scm-plugin/src/main/java/ maven-scm-plugin/src/main/java/org/ maven-scm-plugin/src/main/java/org/apache/ maven-scm-plugin/src/main/ja...
Date Thu, 30 Jun 2005 18:00:50 GMT
Author: evenisse
Date: Thu Jun 30 11:00:49 2005
New Revision: 208653

URL: http://svn.apache.org/viewcvs?rev=208653&view=rev
Log:
Start m2 scm plugin.

Added:
    maven/scm/trunk/maven-scm-plugin/   (with props)
    maven/scm/trunk/maven-scm-plugin/pom.xml   (with props)
    maven/scm/trunk/maven-scm-plugin/src/
    maven/scm/trunk/maven-scm-plugin/src/main/
    maven/scm/trunk/maven-scm-plugin/src/main/java/
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
  (with props)
    maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java
  (with props)
Modified:
    maven/scm/trunk/pom.xml

Propchange: maven/scm/trunk/maven-scm-plugin/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Thu Jun 30 11:00:49 2005
@@ -0,0 +1,3 @@
+target
+.classpath
+.project

Added: maven/scm/trunk/maven-scm-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-plugin/pom.xml?rev=208653&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/pom.xml (added)
+++ maven/scm/trunk/maven-scm-plugin/pom.xml Thu Jun 30 11:00:49 2005
@@ -0,0 +1,49 @@
+<project>
+  <parent>
+    <artifactId>maven-plugin-parent</artifactId>
+    <groupId>org.apache.maven.plugins</groupId>
+    <version>2.0-beta-1-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>maven-scm-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>Maven SCM Plugin</name>
+  <version>1.0-alpha-2-SNAPSHOT</version>
+  <dependencies>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-scm</artifactId>
+      <version>1.0-alpha-1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-clearcase</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-cvs</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-local</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-perforce</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-starteam</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency>
+    <!-- dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-cvs</artifactId>
+      <version>1.0-alpha-2-SNAPSHOT</version>
+    </dependency -->
+  </dependencies>
+</project>

Propchange: maven/scm/trunk/maven-scm-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-plugin/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java?rev=208653&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
Thu Jun 30 11:00:49 2005
@@ -0,0 +1,53 @@
+package org.apache.maven.scm.plugin;
+
+/*
+ * Copyright 2001-2005 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.plugin.AbstractMojo;
+import org.codehaus.plexus.scm.ScmManager;
+
+import java.io.File;
+
+/**
+ * @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public abstract class AbstractScmMojo
+    extends AbstractMojo
+{
+    /**
+     * @parameter expression="${basedir}"
+     * @required
+     */
+    private File workingDirectory;
+
+    /**
+     * @parameter expression="${component.org.codehaus.plexus.scm.ScmManager}"
+     * @required
+     * @readonly
+     */
+    private ScmManager manager;
+
+    public File getWorkingDirectory()
+    {
+        return workingDirectory;
+    }
+
+    public ScmManager getScmManager()
+    {
+        return manager;
+    }
+}

Propchange: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/AbstractScmMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java?rev=208653&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
Thu Jun 30 11:00:49 2005
@@ -0,0 +1,87 @@
+package org.apache.maven.scm.plugin;
+
+/*
+ * Copyright 2001-2005 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.plugin.MojoExecutionException;
+import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.command.Command;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.repository.ScmRepository;
+
+import java.io.File;
+
+/**
+ * @goal checkout
+ * @description Check out a project
+ *
+ * @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class CheckoutMojo
+    extends AbstractScmMojo
+{
+    /**
+     * @parameter expression="${connectionUrl}
+     * @required
+     */
+    private String connectionUrl;
+
+    /**
+     * @parameter expression="${branch}
+     */
+    private String branch;
+
+    /**
+     * @parameter expression="${tag}
+     */
+    private String tag;
+
+    public void execute()
+        throws MojoExecutionException
+    {
+        try
+        {
+            getScmManager().addListener( new DefaultLog( getLog() ) );
+
+            ScmRepository repository = getScmManager().makeScmRepository( connectionUrl );
+
+            String currentTag = null;
+
+            if ( branch != null )
+            {
+                currentTag = branch;
+            }
+
+            if ( tag != null )
+            {
+                currentTag = tag;
+            }
+
+            CheckOutScmResult result = getScmManager().checkOut( repository, new ScmFileSet(
getWorkingDirectory() ), currentTag );
+
+            if ( !result.isSuccess() )
+            {
+                getLog().error( result.getCommandOutput() );
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new MojoExecutionException( "Cannot run checkout command : ", e );
+        }
+    }
+}
+

Propchange: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/CheckoutMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java?rev=208653&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java
(added)
+++ maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java
Thu Jun 30 11:00:49 2005
@@ -0,0 +1,163 @@
+package org.apache.maven.scm.plugin;
+
+/*
+ * 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.log.ScmLogger;
+import org.apache.maven.plugin.logging.Log;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id:$
+ */
+public class DefaultLog
+    implements ScmLogger
+{
+    private Log logger;
+
+    public DefaultLog( Log logger )
+    {
+        this.logger = logger;
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isDebugEnabled()
+     */
+    public boolean isDebugEnabled()
+    {
+        return logger.isDebugEnabled();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.String)
+     */
+    public void debug( String content )
+    {
+        logger.debug( content );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.String, java.lang.Throwable)
+     */
+    public void debug( String content, Throwable error )
+    {
+        logger.debug( content, error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#debug(java.lang.Throwable)
+     */
+    public void debug( Throwable error )
+    {
+        logger.debug( error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isInfoEnabled()
+     */
+    public boolean isInfoEnabled()
+    {
+        return logger.isInfoEnabled();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.String)
+     */
+    public void info( String content )
+    {
+        logger.info( content );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.String, java.lang.Throwable)
+     */
+    public void info( String content, Throwable error )
+    {
+        logger.info( content, error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#info(java.lang.Throwable)
+     */
+    public void info( Throwable error )
+    {
+        logger.info( error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isWarnEnabled()
+     */
+    public boolean isWarnEnabled()
+    {
+        return logger.isWarnEnabled();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.String)
+     */
+    public void warn( String content )
+    {
+        logger.warn( content );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.String, java.lang.Throwable)
+     */
+    public void warn( String content, Throwable error )
+    {
+        logger.warn( content, error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#warn(java.lang.Throwable)
+     */
+    public void warn( Throwable error )
+    {
+        logger.warn( error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#isErrorEnabled()
+     */
+    public boolean isErrorEnabled()
+    {
+        return logger.isErrorEnabled();
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.String)
+     */
+    public void error( String content )
+    {
+        logger.error( content );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.String, java.lang.Throwable)
+     */
+    public void error( String content, Throwable error )
+    {
+        logger.error( content, error );
+    }
+
+    /**
+     * @see org.apache.maven.scm.log.ScmLogger#error(java.lang.Throwable)
+     */
+    public void error( Throwable error )
+    {
+        logger.error( error );
+    }
+}

Propchange: maven/scm/trunk/maven-scm-plugin/src/main/java/org/apache/maven/scm/plugin/DefaultLog.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Modified: maven/scm/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/pom.xml?rev=208653&r1=208652&r2=208653&view=diff
==============================================================================
--- maven/scm/trunk/pom.xml (original)
+++ maven/scm/trunk/pom.xml Thu Jun 30 11:00:49 2005
@@ -61,6 +61,7 @@
   <modules>
     <module>maven-scm-api</module>
     <module>maven-scm-client</module>
+    <module>maven-scm-plugin</module>
     <module>maven-scm-providers</module>
     <module>maven-scm-test</module>
   </modules>



Mime
View raw message