maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r477249 - in /maven/wagon/trunk/wagon-providers: ./ wagon-ssh-ganymed/ wagon-ssh-ganymed/src/ wagon-ssh-ganymed/src/main/ wagon-ssh-ganymed/src/main/java/ wagon-ssh-ganymed/src/main/java/org/ wagon-ssh-ganymed/src/main/java/org/apache/ wago...
Date Mon, 20 Nov 2006 16:43:43 GMT
Author: brett
Date: Mon Nov 20 08:43:42 2006
New Revision: 477249

URL: http://svn.apache.org/viewvc?view=rev&rev=477249
Log:
Add the Ganymed version of the SSH wagn

Added:
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/   (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/pom.xml   (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/components.xml
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/KnownHostsProviderTest.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonTest.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonWithSshPrivateKeySearchTest.java
  (with props)
    maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/SshCommandExecutorTest.java
  (with props)
Modified:
    maven/wagon/trunk/wagon-providers/pom.xml

Modified: maven/wagon/trunk/wagon-providers/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/pom.xml?view=diff&rev=477249&r1=477248&r2=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/pom.xml (original)
+++ maven/wagon/trunk/wagon-providers/pom.xml Mon Nov 20 08:43:42 2006
@@ -20,6 +20,7 @@
     <module>wagon-ssh-common</module>
     <module>wagon-ssh-common-test</module>
     <module>wagon-ssh</module>
+    <module>wagon-ssh-ganymed</module>
     <module>wagon-webdav</module>
   </modules>
   <dependencies>

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 20 08:43:42 2006
@@ -0,0 +1,2 @@
+target
+*.iml

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/pom.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/pom.xml?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/pom.xml (added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/pom.xml Mon Nov 20 08:43:42 2006
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+  <parent>
+    <artifactId>wagon-providers</artifactId>
+    <groupId>org.apache.maven.wagon</groupId>
+    <version>1.0-beta-2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>wagon-ssh-ganymed</artifactId>
+  <name>Maven Wagon Ganymed SSH Provider</name>
+
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.codehaus.org/browse/WAGONSSH</url>
+  </issueManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <!-- These require an ssh server on localhost -->
+          <excludes>
+            <!--
+                        <exclude>**/ScpWagon*Test.*</exclude>
+                        <exclude>**/SshCommandExecutorTest.*</exclude>
+            -->
+            <!-- Don't pass yet -->
+            <exclude>**/KnownHostsProviderTest.*</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <!-- TODO: push common code into a common place -->
+  <dependencies>
+    <dependency>
+      <groupId>ch.ethz.ganymed</groupId>
+      <artifactId>ganymed-ssh2</artifactId>
+      <version>build210</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.wagon</groupId>
+      <artifactId>wagon-ssh-common-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,193 @@
+package org.apache.maven.wagon.providers.ssh.ganymed;
+
+/*
+ * Copyright 2001-2006 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 ch.ethz.ssh2.Connection;
+import ch.ethz.ssh2.HTTPProxyData;
+import ch.ethz.ssh2.ProxyData;
+import ch.ethz.ssh2.Session;
+import ch.ethz.ssh2.StreamGobbler;
+import org.apache.maven.wagon.CommandExecutionException;
+import org.apache.maven.wagon.Streams;
+import org.apache.maven.wagon.authentication.AuthenticationException;
+import org.apache.maven.wagon.providers.ssh.AbstractSshWagon;
+import org.apache.maven.wagon.providers.ssh.CommandExecutorStreamProcessor;
+import org.codehaus.plexus.util.IOUtil;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+public abstract class AbstractGanymedWagon
+    extends AbstractSshWagon
+{
+    protected Connection connection;
+
+    public void openConnection()
+        throws AuthenticationException
+    {
+        super.openConnection();
+
+        String host = getRepository().getHost();
+        int port = getPort();
+
+        File privateKey = getPrivateKey();
+
+/* TODO!
+        if ( !interactive )
+        {
+            interactiveUserInfo = new NullInteractiveUserInfo();
+            uIKeyboardInteractive = null;
+        }
+*/
+
+        connection = new Connection( host, port );
+
+        if ( proxyInfo != null && proxyInfo.getHost() != null )
+        {
+            ProxyData proxy = new HTTPProxyData( proxyInfo.getHost(), proxyInfo.getPort(),
proxyInfo.getUserName(),
+                                                 proxyInfo.getPassword() );
+
+            connection.setProxyData( proxy );
+        }
+
+        /* TODO! need to create a custom ServerHostKeyVerifier, and then pass that to connect
later on.
+          Note: the verifier will also need to add to ~/.ssh/known_hosts if it happens to
be updated
+
+        if ( knownHostsProvider != null )
+        {
+            try
+            {
+                String contents = knownHostsProvider.getContents();
+                if ( contents != null )
+                {
+                    sch.setKnownHosts( new StringInputStream( contents ) );
+                }
+            }
+            catch ( JSchException e )
+            {
+                fireSessionError( e );
+                // continue without known_hosts
+            }
+        }
+        */
+
+        try
+        {
+            // TODO: connection timeout?
+            connection.connect();
+        }
+        catch ( IOException e )
+        {
+            fireSessionError( e );
+            throw new AuthenticationException( "Cannot connect. Reason: " + e.getMessage(),
e );
+        }
+
+        try
+        {
+            boolean authenticated;
+
+            if ( privateKey != null && privateKey.exists() )
+            {
+                authenticated = connection.authenticateWithPublicKey( authenticationInfo.getUserName(),
privateKey,
+                                                                      authenticationInfo.getPassphrase()
);
+            }
+            else
+            {
+                authenticated = connection.authenticateWithPassword( authenticationInfo.getUserName(),
+                                                                     authenticationInfo.getPassword()
);
+            }
+            // TODO! keyboard interactive
+
+            if ( !authenticated )
+            {
+                throw new AuthenticationException( "Authentication failed." );
+            }
+        }
+        catch ( IOException e )
+        {
+            closeConnection();
+            fireSessionError( e );
+            throw new AuthenticationException( "Cannot authenticate. Reason: " + e.getMessage(),
e );
+        }
+    }
+
+    // TODO! factor out into a separate class?
+    public Streams executeCommand( String command, boolean ignoreFailures )
+        throws CommandExecutionException
+    {
+        fireTransferDebug( "Executing command: " + command );
+
+        Session session;
+        try
+        {
+            session = connection.openSession();
+        }
+        catch ( IOException e )
+        {
+            throw new CommandExecutionException( "Cannot open session. Reason: " + e.getMessage(),
e );
+        }
+
+        try
+        {
+            session.execCommand( command );
+        }
+        catch ( IOException e )
+        {
+            throw new CommandExecutionException( "Cannot execute remote command: " + command,
e );
+        }
+
+        InputStream stdout = new StreamGobbler( session.getStdout() );
+        InputStream stderr = new StreamGobbler( session.getStderr() );
+
+        BufferedReader stdoutReader = new BufferedReader( new InputStreamReader( stdout )
);
+        BufferedReader stderrReader = new BufferedReader( new InputStreamReader( stderr )
);
+
+        try
+        {
+            Streams streams = CommandExecutorStreamProcessor.processStreams( stderrReader,
stdoutReader );
+
+            if ( streams.getErr().length() > 0 )
+            {
+                int exitCode = session.getExitStatus().intValue();
+                throw new CommandExecutionException( "Exit code: " + exitCode + " - " + streams.getErr()
);
+            }
+
+            return streams;
+        }
+        catch ( IOException e )
+        {
+            throw new CommandExecutionException( "Cannot read streams after remote command:
" + command, e );
+        }
+        finally
+        {
+            IOUtil.close( stdoutReader );
+            IOUtil.close( stderrReader );
+        }
+    }
+
+    public void closeConnection()
+    {
+        if ( connection != null )
+        {
+            connection.close();
+            connection = null;
+        }
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/AbstractGanymedWagon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,188 @@
+package org.apache.maven.wagon.providers.ssh.ganymed;
+
+/*
+ * Copyright 2001-2006 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 ch.ethz.ssh2.SCPClient;
+import org.apache.maven.wagon.CommandExecutionException;
+import org.apache.maven.wagon.PathUtils;
+import org.apache.maven.wagon.PermissionModeUtils;
+import org.apache.maven.wagon.ResourceDoesNotExistException;
+import org.apache.maven.wagon.TransferFailedException;
+import org.apache.maven.wagon.authorization.AuthorizationException;
+import org.apache.maven.wagon.events.TransferEvent;
+import org.apache.maven.wagon.repository.RepositoryPermissions;
+import org.apache.maven.wagon.resource.Resource;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+/**
+ * A base class for deployers and fetchers using protocols from SSH2 family and
+ * JSch library for underlying implementation
+ * <p/>
+ * This is responsible for authentification stage of the process.
+ * <p/>
+ * We will first try to use public keys for authentication and if that doesn't
+ * work then we fall back to using the login and password
+ *
+ * @version $Id: ScpWagon.java 430944 2006-08-12 02:02:20Z carlos $
+ * @todo [BP] add compression flag
+ */
+public class ScpWagon
+    extends AbstractGanymedWagon
+{
+    public void put( File source, String destination )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        String basedir = getRepository().getBasedir();
+
+        destination = StringUtils.replace( destination, "\\", "/" );
+        String dir = PathUtils.dirname( destination );
+        dir = StringUtils.replace( dir, "\\", "/" );
+
+        Resource resource = new Resource( destination );
+
+        firePutInitiated( resource, source );
+
+        try
+        {
+            String umaskCmd = null;
+            if ( getRepository().getPermissions() != null )
+            {
+                String dirPerms = getRepository().getPermissions().getDirectoryMode();
+
+                if ( dirPerms != null )
+                {
+                    umaskCmd = "umask " + PermissionModeUtils.getUserMaskFor( dirPerms );
+                }
+            }
+
+            String mkdirCmd = "mkdir -p " + getPath( basedir, dir );
+
+            if ( umaskCmd != null )
+            {
+                mkdirCmd = umaskCmd + "; " + mkdirCmd;
+            }
+
+            executeCommand( mkdirCmd );
+        }
+        catch ( CommandExecutionException e )
+        {
+            throw new TransferFailedException( "Error performing commands for file transfer",
e );
+        }
+
+        String path = getPath( basedir, destination );
+
+        RepositoryPermissions permissions = getRepository().getPermissions();
+
+        firePutStarted( resource, source );
+
+        // TODO: should we just incorporate this code directly to be able to use the normal
putTransfer and tracking?
+        SCPClient client = new SCPClient( connection );
+        try
+        {
+            int index = path.lastIndexOf( '/' );
+            client.put( source.getAbsolutePath(), path.substring( index + 1 ), path.substring(
0, index ),
+                        getOctalMode( permissions ) );
+        }
+        catch ( IOException e )
+        {
+            throw new TransferFailedException( "Error transferring file. Reason: " + e.getMessage(),
e );
+        }
+
+        postProcessListeners( resource, source, TransferEvent.REQUEST_PUT );
+
+        firePutCompleted( resource, source );
+
+        try
+        {
+            if ( permissions != null && permissions.getGroup() != null )
+            {
+                executeCommand( "chgrp -f " + permissions.getGroup() + " " + path );
+            }
+        }
+        catch ( CommandExecutionException e )
+        {
+            throw new TransferFailedException( "Error performing commands for file transfer",
e );
+        }
+    }
+
+    public void get( String resourceName, File destination )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        Resource resource = new Resource( resourceName );
+
+        fireGetInitiated( resource, destination );
+
+        String basedir = getRepository().getBasedir();
+
+        String path = getPath( basedir, resourceName );
+
+        destination.getParentFile().mkdirs();
+
+        OutputStream os;
+        try
+        {
+            os = new FileOutputStream( destination );
+        }
+        catch ( FileNotFoundException e )
+        {
+            throw new TransferFailedException( "Error writing output file. Reason: " + e.getMessage(),
e );
+        }
+
+        try
+        {
+            fireGetStarted( resource, destination );
+
+            // TODO: should we just incorporate this code directly to be able to use the
normal putTransfer and tracking?
+            SCPClient client = new SCPClient( connection );
+            client.get( path, os );
+
+            postProcessListeners( resource, destination, TransferEvent.REQUEST_GET );
+
+            fireGetCompleted( resource, destination );
+        }
+        catch ( IOException e )
+        {
+            if ( e.getCause().getMessage().trim().endsWith( "No such file or directory" )
)
+            {
+                throw new ResourceDoesNotExistException( e.getMessage().trim() );
+            }
+            else
+            {
+                throw new TransferFailedException( "Error transferring file. Reason: " +
e.getMessage(), e );
+            }
+        }
+        finally
+        {
+            IOUtil.close( os );
+        }
+    }
+
+    public boolean getIfNewer( String resourceName, File destination, long timestamp )
+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
+    {
+        // TODO Implement ScpWagon.getIfNewer()
+        throw new UnsupportedOperationException( "getIfNewer in scp wagon is not implemented"
);
+    }
+
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/components.xml
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/components.xml
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,33 @@
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.wagon.Wagon</role>
+      <role-hint>scp</role-hint>
+      <implementation>org.apache.maven.wagon.providers.ssh.ganymed.ScpWagon</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProvider</role>
+          <role-hint>file</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.wagon.providers.ssh.interactive.InteractiveUserInfo</role>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>org.apache.maven.wagon.CommandExecutor</role>
+      <implementation>org.apache.maven.wagon.providers.ssh.ganymed.ScpWagon</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProvider</role>
+          <role-hint>file</role-hint>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.wagon.providers.ssh.interactive.InteractiveUserInfo</role>
+        </requirement>
+      </requirements>
+    </component>
+  </components>
+</component-set>

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/KnownHostsProviderTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/KnownHostsProviderTest.java?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/KnownHostsProviderTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/KnownHostsProviderTest.java
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,32 @@
+package org.apache.maven.wagon.providers.ssh.ganymed;
+
+import org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProviderTestCase;
+
+/*
+ * Copyright 2001-2006 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.
+ */
+
+/**
+ * Generic Unit test for <code>KnownHostsProvider</code>
+ *
+ * @author Juan F. Codagnone
+ * @see org.apache.maven.wagon.providers.ssh.knownhost.KnownHostsProvider
+ * @since Sep 12, 2005
+ */
+public class KnownHostsProviderTest
+    extends KnownHostsProviderTestCase
+{
+
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/KnownHostsProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonTest.java?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonTest.java
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,44 @@
+package org.apache.maven.wagon.providers.ssh.ganymed;
+
+import org.apache.maven.wagon.WagonTestCase;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+import org.apache.maven.wagon.providers.ssh.TestData;
+
+import java.io.File;
+
+/**
+ * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
+ * @version $Id: ScpWagonTest.java 312572 2005-10-10 07:17:58Z brett $
+ */
+public class ScpWagonTest
+    extends WagonTestCase
+{
+    protected String getProtocol()
+    {
+        return "scp";
+    }
+
+    public String getTestRepositoryUrl()
+    {
+        return TestData.getTestRepositoryUrl();
+    }
+
+    protected AuthenticationInfo getAuthInfo()
+    {
+        AuthenticationInfo authInfo = super.getAuthInfo();
+
+        authInfo.setUserName( TestData.getUserName() );
+
+        File privateKey = TestData.getPrivateKey();
+
+        if ( privateKey.exists() )
+        {
+            authInfo.setPrivateKey( privateKey.getAbsolutePath() );
+
+            authInfo.setPassphrase( "" );
+        }
+
+        return authInfo;
+    }
+
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonWithSshPrivateKeySearchTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonWithSshPrivateKeySearchTest.java?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonWithSshPrivateKeySearchTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonWithSshPrivateKeySearchTest.java
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,37 @@
+package org.apache.maven.wagon.providers.ssh.ganymed;
+
+import org.apache.maven.wagon.WagonTestCase;
+import org.apache.maven.wagon.authentication.AuthenticationInfo;
+import org.apache.maven.wagon.providers.ssh.TestData;
+
+/**
+ * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
+ * @version $Id: ScpWagonWithSshPrivateKeySearchTest.java 312572 2005-10-10 07:17:58Z brett
$
+ */
+public class ScpWagonWithSshPrivateKeySearchTest
+    extends WagonTestCase
+{
+    protected String getProtocol()
+    {
+        return "scp";
+    }
+
+    public String getTestRepositoryUrl()
+    {
+        return TestData.getTestRepositoryUrl();
+    }
+
+
+    protected AuthenticationInfo getAuthInfo()
+    {
+        AuthenticationInfo authInfo = super.getAuthInfo();
+
+        authInfo.setUserName( TestData.getUserName() );
+
+        authInfo.setPassphrase( "" );
+
+        return authInfo;
+    }
+
+
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/ScpWagonWithSshPrivateKeySearchTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/SshCommandExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/SshCommandExecutorTest.java?view=auto&rev=477249
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/SshCommandExecutorTest.java
(added)
+++ maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/SshCommandExecutorTest.java
Mon Nov 20 08:43:42 2006
@@ -0,0 +1,20 @@
+package org.apache.maven.wagon.providers.ssh.ganymed;
+
+import org.apache.maven.wagon.CommandExecutorTestCase;
+import org.apache.maven.wagon.repository.Repository;
+
+/**
+ * Test the command executor.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ * @version $Id: SshCommandExecutorTest.java 312781 2005-10-11 02:04:28Z brett $
+ */
+public class SshCommandExecutorTest
+    extends CommandExecutorTestCase
+{
+
+    protected Repository getTestRepository()
+    {
+        return new Repository( "test", "scp://localhost/" );
+    }
+}

Propchange: maven/wagon/trunk/wagon-providers/wagon-ssh-ganymed/src/test/java/org/apache/maven/wagon/providers/ssh/ganymed/SshCommandExecutorTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message