evenisse 2004/02/24 08:44:56 Added: maven-plugins/maven-scm-plugin .cvsignore project.xml maven-plugins/maven-scm-plugin/src/java/org/apache/maven/plugin ScmPlugin.java maven-plugins/maven-scm-plugin/src/resources/META-INF/maven plugin.xml maven-plugins/maven-scm-plugin/src/resources/META-INF/plexus components.xml Log: A first draft for scm plugin Revision Changes Path 1.1 maven-components/maven-plugins/maven-scm-plugin/.cvsignore Index: .cvsignore =================================================================== *~ *.log target *.ipr *.iws 1.1 maven-components/maven-plugins/maven-scm-plugin/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1"?> <project> <pomVersion>3</pomVersion> <id>maven-scm-plugin</id> <groupId>maven</groupId> <artifactId>maven-scm-plugin</artifactId> <name>Maven</name> <currentVersion>1.0-SNAPSHOT</currentVersion> <organization> <name>Apache Software Foundation</name> <url>http://www.apache.org/</url> <logo>/images/apache-maven-project.png</logo> </organization> <inceptionYear>2001</inceptionYear> <package>org.apache.maven</package> <logo>/images/maven.gif</logo> <repository> <connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:maven-components/maven-plugins/maven-scm-plugin</connection> <developerConnection>scm:cvs:ext:[EMAIL PROTECTED]:/home/cvs:maven-components/maven-plugins/maven-scm-plugin</developerConnection> <url>http://cvs.apache.org/viewcvs.cgi/maven/</url> </repository> <versions/> <branches/> <mailingLists/> <developers> <developer> <name>Emmanuel Venisse</name> <id>evenisse</id> <email>[EMAIL PROTECTED]</email> <organization/> <roles> <role>Creator</role> <role>Project Leader</role> <role>Release Manager</role> </roles> </developer> </developers> <contributors/> <licenses/> <dependencies> <dependency> <groupId>maven</groupId> <artifactId>scm-api</artifactId> <version>1.0-beta-1-SNAPSHOT</version> </dependency> <dependency> <groupId>maven</groupId> <artifactId>scm-cvslib</artifactId> <version>1.0-beta-1-SNAPSHOT</version> </dependency> <dependency> <groupId>maven</groupId> <artifactId>maven-core</artifactId> <version>2.0-SNAPSHOT</version> </dependency> <dependency> <groupId>maven</groupId> <artifactId>maven-model</artifactId> <version>2.0-SNAPSHOT</version> </dependency> <dependency> <groupId>maven</groupId> <artifactId>maven-model-xpp3</artifactId> <version>2.0-SNAPSHOT</version> </dependency> <dependency> <groupId>maven</groupId> <artifactId>maven-project</artifactId> <version>2.0-SNAPSHOT</version> </dependency> <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> <version>1.0-beta-2</version> </dependency> <!-- Plexus --> <dependency> <groupId>xpp3</groupId> <artifactId>xpp3</artifactId> <version>1.1.3.3</version> </dependency> <dependency> <groupId>plexus</groupId> <artifactId>plexus</artifactId> <version>0.14-SNAPSHOT</version> </dependency> <dependency> <groupId>plexus</groupId> <artifactId>plexus-i18n</artifactId> <version>1.0-beta-2-SNAPSHOT</version> </dependency> <dependency> <groupId>classworlds</groupId> <artifactId>classworlds</artifactId> <version>1.1-SNAPSHOT</version> </dependency> <dependency> <groupId>xstream</groupId> <artifactId>xstream</artifactId> <version>0.3</version> </dependency> <dependency> <groupId>plexus</groupId> <artifactId>plexus-compiler</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies> <build> <nagEmailAddress>[EMAIL PROTECTED]</nagEmailAddress> <sourceDirectory>src/java</sourceDirectory> <unitTestSourceDirectory>src/test</unitTestSourceDirectory> <unitTest> <includes> <include>**/*Test.java</include> </includes> </unitTest> <resources> <resource> <directory>src/resources</directory> </resource> </resources> </build> </project> 1.1 maven-components/maven-plugins/maven-scm-plugin/src/java/org/apache/maven/plugin/ScmPlugin.java Index: ScmPlugin.java =================================================================== package org.apache.maven.plugin; /* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" and * "Apache Maven" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", * "Apache Maven", nor may "Apache" appear in their name, without * prior written permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * ==================================================================== */ import org.apache.maven.scm.manager.DefaultScmManager; import org.apache.maven.scm.command.Command; /** * * @author <a href="[EMAIL PROTECTED]">Emmanuel Venisse</a> * @version $Id: ScmPlugin.java,v 1.1 2004/02/24 16:44:56 evenisse Exp $ */ public class ScmPlugin { private String commandName; private String connection; private String basedir; public void execute() throws Exception { DefaultScmManager scmManager = new DefaultScmManager( connection ); try { Command command = scmManager.getCommand( commandName ); command.setWorkingDirectory( basedir ); command.execute(); } catch ( Exception e ) { e.printStackTrace(); throw new Exception( "Cannot run " + commandName + " command : ", e ); } } } 1.1 maven-components/maven-plugins/maven-scm-plugin/src/resources/META-INF/maven/plugin.xml Index: plugin.xml =================================================================== <plugin> <id>scm</id> <goals> <goal> <name>scm:checkout</name> <prereqs> <prereq>resources</prereq> </prereqs> <configuration> <commandName>checkout</commandName> <connection>#project.repository.connection</connection> <basedir>#basedir</basedir> </configuration> </goal> </goals> </plugin> 1.1 maven-components/maven-plugins/maven-scm-plugin/src/resources/META-INF/plexus/components.xml Index: components.xml =================================================================== <component-set> <components> <component> <role>org.apache.maven.plugin.Plugin</role> <role-hint>scm</role-hint> <implementation>org.apache.maven.plugin.ScmPlugin</implementation> </component> </components> </component-set>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]