michal      2003/06/29 04:57:40

  Modified:    src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions
                        DeployException.java
               src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer
                        DefaultArtifactDeployer.java DeployBean.java
                        DeployRequestBuilder.java ArtifactDeployer.java
               src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers
                        HttpDeployer.java FtpDeployer.java
                        SFtpDeployer.java ScpDeployer.java
                        FileDeployer.java Deployer.java
                        GenericSshDeployer.java
               src/plugins-build/artifact/src/main/org/apache/maven/deploy
                        DeployRequest.java DeployTool.java
  Added:       src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions
                        UnsupportedProtocolException.java
                        TransferFailedException.java
                        WrongParameterException.java
               src/plugins-build/artifact/xdocs protocols.xml examples.xml
                        index.xml tags.xml navigation.xml
                        authentification.xml properties.xml changes.xml
                        security.xml .cvsignore
  Removed:     src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions
                        UnsupportedProtocolDeployException.java
  Log:
  Code clean-up and docs provided
  
  Revision  Changes    Path
  1.2       +3 -3      
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions/DeployException.java
  
  Index: DeployException.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions/DeployException.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeployException.java      17 Jun 2003 22:06:00 -0000      1.1
  +++ DeployException.java      29 Jun 2003 11:57:39 -0000      1.2
  @@ -58,11 +58,11 @@
   
   
   /**
  - * 
  + * Root class for all exception thrown by Deployers
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
    * @version $Id$
    */
  -public class DeployException extends Exception
  +public abstract class DeployException extends Exception
   {
       private final String message;
       private final Throwable cause;
  
  
  
  1.1                  
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions/UnsupportedProtocolException.java
  
  Index: UnsupportedProtocolException.java
  ===================================================================
  package org.apache.maven.deploy.exceptions;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 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/>.
   *
   * ====================================================================
   */
  
  
  /**
   * 
   * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
   * @version $Id: UnsupportedProtocolException.java,v 1.1 2003/06/29 11:57:39 michal 
Exp $
   */
  public class UnsupportedProtocolException extends DeployException
  {
      /**
       * @param message
       */
      public UnsupportedProtocolException(String message)
      {
          super(message);
      }
  
       /**
       * @param message
       * @param cause
       */
      public UnsupportedProtocolException(String message, Throwable cause)
      {
          super(message, cause);
      }
  
  }
  
  
  
  1.1                  
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions/TransferFailedException.java
  
  Index: TransferFailedException.java
  ===================================================================
  package org.apache.maven.deploy.exceptions;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 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/>.
   *
   * ====================================================================
   */
  
  
  /**
   * Exception which should be thrown when IO error occures during 
   * making remote copy of the file
   * 
   * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
   * @version $Id: TransferFailedException.java,v 1.1 2003/06/29 11:57:39 michal Exp $
   */
  public class TransferFailedException extends DeployException
  {
  
      /**
       * @param message
       */
      public TransferFailedException(String message)
      {
          super(message);
      }
  
      /**
       * @param message
       * @param cause
       */
      public TransferFailedException(String message, Throwable cause)
      {
          super(message, cause);
          // TODO Auto-generated constructor stub
      }
  
  }
  
  
  
  1.1                  
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/exceptions/WrongParameterException.java
  
  Index: WrongParameterException.java
  ===================================================================
  package org.apache.maven.deploy.exceptions;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 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/>.
   *
   * ====================================================================
   */
  
  /**
   * 
   * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
   * @version $Id: WrongParameterException.java,v 1.1 2003/06/29 11:57:39 michal Exp $
   */
  public class WrongParameterException extends DeployException
  {
  
      /**
       * @param message
       */
      public WrongParameterException(String message)
      {
          super(message);
      }
  
      /**
       * @param message
       * @param cause
       */
      public WrongParameterException(String message, Throwable cause)
      {
          super(message, cause);
      }
  
  }
  
  
  
  1.10      +29 -15    
maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java
  
  Index: DefaultArtifactDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/DefaultArtifactDeployer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultArtifactDeployer.java      25 Jun 2003 15:25:19 -0000      1.9
  +++ DefaultArtifactDeployer.java      29 Jun 2003 11:57:39 -0000      1.10
  @@ -82,7 +82,7 @@
   {
   
       /**
  -     * 
  +     * Date/time stamp which is appended to snapshot filenames  
        */
       public final static DateFormat SNAPSHOT_MARKER =
           new SimpleDateFormat("yyyyMMdd.HHmmss");
  @@ -191,8 +191,8 @@
       }
   
       /**
  -     * Install given file in local repsoitory 
  -     * @param artifact the artifact file to insatall 
  +     * Install given file in local repository 
  +     * @param artifact the artifact file to install 
        * @param type The type of the artiafct
        * @param project 
        * @param version String denominating the version of the artifact 
  @@ -254,10 +254,8 @@
           // trick add special values to context for default repository;
   
           String repos =
  -            (String) project.getContext().getVariable("maven.repo.repos");
  -
  -        System.out.println("repos: " + repos);
  -
  +            (String) project.getContext().getVariable("maven.repo.list");
  +                
           String distSite = project.getDistributionSite();
           if (distSite != null && distSite.length() > 0)
           {
  @@ -273,7 +271,7 @@
   
           if (repos == null || repos.length() == 0)
           {
  -            System.out.println("No remote repository is defined");
  +            System.out.println("No remote repository is defined for deployment");
               return;
           }
           String[] repoArray = StringUtils.split(repos, ",");
  @@ -328,8 +326,9 @@
       }
   
       /**
  -     * 
  +     * Return the local repository path form given project
        * @param project
  +     * @return The path to local repoository in local file system
        */
       private String getLocalRepository(Project project)
       {
  @@ -337,11 +336,13 @@
       }
   
       /**
  -     * 
  -     * @param type
  -     * @param project
  +     * Return relative path from  repositorry root 
  +     * for given parameters
  +     * @param type Artifact type
  +     * @param project 
        * @param snapshot
        * @return
  +     * @todo replace this with RepoistoryLayout Service
        */
       private String getRepositoryPath(
           String type,
  @@ -355,6 +356,14 @@
           return path.toString();
       }
   
  +    
  +    /**
  +     * 
  +     * @param type
  +     * @param project
  +     * @param version
  +     * @return
  +     */
       private String getRepositoryFile(
           String type,
           Project project,
  @@ -441,6 +450,11 @@
       }
   
       /**
  +     * Create MD5 checksum file for given file. File is created 
  +     * in the same folder
  +     * @param File
  +     * @return The <code>File</code> which contatins MD5 checksum 
  +     * @throws MavenException when opertaion failed 
        */
       private File createMD5Checksum(File file) throws MavenException
       {
  @@ -475,9 +489,9 @@
       }
   
       /**
  -     * 
  +     * Return file extension for given type
        * @todo Dirty hack util Repository Layout Service is used     
  -     * @return
  +     * @return extension for given type
        */
       private String extensionForType(String type)
       {
  
  
  
  1.3       +2 -3      
maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/DeployBean.java
  
  Index: DeployBean.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/DeployBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeployBean.java   25 Jun 2003 15:25:19 -0000      1.2
  +++ DeployBean.java   29 Jun 2003 11:57:39 -0000      1.3
  @@ -64,7 +64,7 @@
   /**
    * 
    * The Bean which provides access to Artifact Deployement API
  - * for jelly scripts.
  + * from jelly scripts.
    * 
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
    * @version $Id$
  @@ -156,7 +156,6 @@
        */
       public void deploy() throws MavenException
       {
  -        System.out.println("deploy called");
           checkAttributes();
           artifactDeployer.deploy(artifact, type, project);
       }
  
  
  
  1.2       +14 -15    
maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/DeployRequestBuilder.java
  
  Index: DeployRequestBuilder.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/DeployRequestBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DeployRequestBuilder.java 25 Jun 2003 15:25:19 -0000      1.1
  +++ DeployRequestBuilder.java 29 Jun 2003 11:57:39 -0000      1.2
  @@ -58,6 +58,7 @@
   
   import org.apache.maven.deploy.DeployRequest;
   import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.WrongParameterException;
   import org.apache.maven.project.Project;
   
   /**
  @@ -122,29 +123,27 @@
                   "maven.repo." + repository + ".group");
   
           String proxyHost =
  -            (String) project.getContext().getVariable(
  -                "maven.repo." + repository + ".proxy");
  +            (String) project.getContext().getProxyHost();                
           String proxyUser =
  -            (String) project.getContext().getVariable(
  -                "maven.repo." + repository + ".proxy.username");
  +            (String) project.getContext().getProxyUserName();
  +               
   
           String proxyPassword =
  -            (String) project.getContext().getVariable(
  -                "maven.repo." + repository + ".proxy.password");
  +            (String) project.getContext().getProxyPassword();
  +                
   
           String proxyPort =
  -            (String) project.getContext().getVariable(
  -                "maven." + repository + ".proxy.port");
  -
  -        request.setUser(username);
  +            (String) project.getContext().getProxyPort();
  +                
  +        request.setUserName(username);
           request.setPassword(password);
           request.setPassphrase(passphrase);
           request.setPrivateKey(privateKey);
           request.setGroup(remoteGroup);
           request.setUrl(url);
           request.setProxyHost(proxyHost);
  -        request.setProxyUser(proxyUser);
  -        request.setProxyPass(proxyPassword);
  +        request.setProxyUserName(proxyUser);
  +        request.setProxyPassword(proxyPassword);
           if (port != null)
           {
               try
  @@ -154,7 +153,7 @@
               }
               catch (Exception e)
               {
  -                throw new DeployException("maven.repo." + repository + ".port  
should be an integer");
  +                throw new WrongParameterException("maven.repo." + repository + 
".port  should be an integer");
               }
           }
           if (proxyPort != null)
  @@ -165,7 +164,7 @@
               }
               catch (Exception e)
               {
  -                throw new DeployException("maven.repo." + repository + ".proxy.port 
 should be an integer");
  +                throw new WrongParameterException("maven.repo." + repository + 
".proxy.port  should be an integer");
               }
           }
   
  
  
  
  1.2       +44 -21    
maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/ArtifactDeployer.java
  
  Index: ArtifactDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/artifact/deployer/ArtifactDeployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArtifactDeployer.java     16 Jun 2003 14:26:01 -0000      1.1
  +++ ArtifactDeployer.java     29 Jun 2003 11:57:39 -0000      1.2
  @@ -61,23 +61,39 @@
   
   /**
    * 
  - * The Bean which serves as Proxy To Hibernate API
  - * <br/>
  + * The Bean which is used in Jelly Scripts 
  + * and serves as a proxy to Artifact Deployer API
    * 
  + * Note that all paths in repository are computed 
  + * and source file name is igonred.
  + * 
  + * Other remark: To deploy an artifact means much 
  + * more then to copy signle file. In every case
  + * also MD5 file created and copied  to remote repository.
  + * In case of snapshots the process in even more complex. 
    * 
  - *   
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
    * @version $Id$
    */
   public interface ArtifactDeployer
   {
  -    
  +
       /**
  -     * Deploy given artifact to remote repository
  -     * @param artifact
  -     * @param type
  -     * @param project
  -     * @throws MavenException
  +     * Deploy given artifact to remote repository     
  +     * 
  +     * @param artifact Artifact filename
  +     * @param type  The type of the artifact 
  +     *     (like <code>war</code>, <code>jar</code>)
  +     * @param project The project which is a producer of the artifact
  +     *         POM conatains a bunch of varaiables which are used
  +     *         to control the deployment process (e.g 
  +     *         <ul>
  +     *             <li>artifactId<li>
  +     *             <li>groupId</li>
  +     *             <li>list of remote repositories</li>
  +     *         </ul> 
  +     *          
  +     * @throws MavenException 
        */
       public void deploy(String artifact, String type, Project project)
           throws MavenException;
  @@ -85,30 +101,37 @@
       /**
        * Deploy given artifact as a snapshot to remote repository 
        * @param artifact
  -     * @param type
  -     * @param project
  +     * @param type The type of the artifact 
  +     *     (like <code>war</code>, <code>jar</code>)
  +     * @param project The project which is a producer of the artifact
  +     * @see ArtifactDeployer#deploy(String, String, Project)
  +     * 
        * @throws MavenException
        */
       public void deploySnapshot(String artifact, String type, Project project)
           throws MavenException;
  -        
  +
       /**
        * Install given artifact in local repository
  -     * @param artifact
  -     * @param type
  -     * @param project
  +     * @param artifact file name of the artifact
  +     * @param type The type of the artifact 
  +     *     (like <code>war</code>, <code>jar</code>)
  +     * @param project The project which is a producer of the artifact
        * @throws MavenException
  -     */    
  +     */
       public void install(String artifact, String type, Project project)
           throws MavenException;
  -        
  +
       /**
        * Install given artifact as snapshot in  local repository
        * @param artifact
  -     * @param type
  -     * @param project
  +     * @param type The type of the artifact 
  +     *     (like <code>war</code>, <code>jar</code>)
  +     * @param project The project which is a producer of the artifact
        * @throws MavenException
  -     */    
  +     */
       public void installSnapshot(String artifact, String type, Project project)
           throws MavenException;
  +        
  +               
   }
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/protocols.xml
  
  Index: protocols.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
  
    <properties>
      <title>Maven Artifact Plugin Properties</title>
      <author email="[EMAIL PROTECTED]">Michal Maczka</author>
    </properties>
  
    <body>
      <section name="Supported protocols">
        <table>
          <tr>
            <th>Protocol name</th>
            <th>URL Prefix</th>
            <th>Username</th>
            <th>Directory</th>
            <th>Password</th>
            <th>Group</th>
            <th>Private Key</th>
            <th>Passphrase</th>
            <th>Port</th>
          </tr> 
          <tr>
            <td>
              <b>SCP</b>
              (Secure Copy)
            </td>
            <td>scp://</td>
            <td>Mandatory</td>
            <td>Mandatory</td>
            <td>Mandatory if private key unless private key is provided</td>
            <td>Optional</td>
            <td>Optional</td>
            <td>Optional</td>
            <td>Optional (deafult is 22)</td>        
          </tr> 
          <tr>
            <td>
              <b>SFTP</b>
              (Secure FTP)
            </td>
            <td>sftp://</td>
            <td>Mandatory</td>
            <td>Mandatory</td>
            <td>Mandatory if private key unless private key is provided</td>
            <td>Optional</td>
            <td>Optional</td>
            <td>Optional</td>
            <td>Optional (deafult is 22)</td>        
          </tr>
           <tr>
            <td><b>FTP</b></td>
            <td>ftp://</td>
            <td>Mandatory</td>
            <td>Mandatory</td>
            <td>Mandatory</td>
            <td>Not supported</td>
            <td>Not supported</td>
            <td>Not supported</td>
            <td>Optional (deafult is 21)</td>        
          </tr>            
          <tr>
            <td><b>FILE</b></td>
            <td>file://</td>
            <td>Not supported</td>
            <td>Mandatory</td>
            <td>Not supported</td>
            <td>Not supported</td>
            <td>Not supported</td>
            <td>Not supported</td>
            <td>Not supported</td>        
          </tr>            
        </table>
      </section>
    </body>
  </document>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/examples.xml
  
  Index: examples.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Artifact Plug-in Examples</title>
      <author email="[EMAIL PROTECTED]">Tim Anderson</author>
    </properties>
  
    <body>
      <section name="Examples">
        <p>
          The following example demonstrates how to depoyment
          of artifact to remote repsoitories can be configured.
                 
  <source><![CDATA[
  #list of repositories to which we will deploy. 
  #There are 4 repositories
  maven.repo.repos= R1, R2, R3, R4
  
  #settings for repository 'R1' 
  maven.repo.R1=ftp://ftp.boo.com 
  maven.repo.R1.username=michal
  maven.repo.R1.password=********
  maven.repo.R1.directory=/web/repository
  
  #settings for repository 'R2'
  maven.repo.R2=sftp://host2.com
  maven.repo.R2.username=michal
  maven.repo.R2.password=*********
  maven.repo.R2.port=22 
  maven.repo.R2.directory=maven/repoistory
  maven.repo.R2.group=Michal
  
  #settings for repository 'R3'
  maven.repo.R3=scp://host3.com
  maven.repo.R3.username=michal
  maven.repo.R3.directory=repo
  maven.repo.R3.group=remote_grup
  maven.repo.R3.privatekey=/home/.ssh/id_dsa
  
  #settings for repository 'R4'
  maven.repo.R4=file://c:\\temp
  maven.repo.R4.directory=repository
    
  ]]></source>
        </p>
      </section>
    </body>
  </document>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Artifact Plugin Properties</title>
      <author email="[EMAIL PROTECTED]">Michal Maczka</author>
    </properties>
  
    <body>
      <section name="Maven Artifact Plugin ">
        <subsection name="Overview of the Maven Arifact Plug-in Reference 
Documentation">       
          <p>
            This plugin generates java sources from schemas using Castor.
          </p>
          <table>
            <tr><th>Document</th><th>Description</th></tr>         
            <tr><td><a href="properties.html">Properties</a></td>
              <td>
                The behavior of the Maven Artifact Plug-in can be altered via
                several properties.  This document describes each property
                available, and the default used.
              </td>
            </tr>
            <tr><td><a href="tags.html">Tags</a></td>
              <td>
                The Artifact plugin defines Jelly tags to generate java
                sources. This document describes the tags and their
                arguments.
              </td>
            </tr>
            <tr><td><a href="examples.html">Examples</a></td>
              <td>
                This document provides examples on how to configure the Maven Artifact 
              
                plugin for deploying artifacts to remote repository
              </td>
            </tr>
          </table>
        </subsection>
      </section>
    </body>
  </document>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/tags.xml
  
  Index: tags.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Castor Plug-in Tags</title>
      <author email="[EMAIL PROTECTED]">Tim Anderson</author>
    </properties>
  
    <body>
      <section name="Overview">
        <p>
          This document describes the
          <a href="http://jakarta.apache.org/commons/jelly/tags.html";>tags</a>
          that are available when using the Artifact Plug-in with Maven.
        </p>      
      </section>
  
      <section name="Tags">
        <table>
          <tr><th>Name</th><th>Description</th></tr>
          <tr>
            <td><a href="#artifact:deploy">artifact:delpoy</a></td>
            <td>Deploy artifact to remote repository(ies)</td>
          </tr>
          <tr>
            <td><a href="#artifact:deploy-snapshot">artifact:delpoy-snapshot</a></td>
            <td>Deploy snapshot version of artifact to remote repository</td>
          </tr>
          <tr>
            <td><a href="#artifact:install">artifact:install</a></td>
            <td>Install artifact in local repository</td>
          </tr>
          <tr>
            <td><a href="#artifact:deploy-snapshot">artifact:install-snapshot</a></td>
            <td>Install snapshot version of artifact in local repository</td>
          </tr>
        </table>
        
        <subsection name="artifact:deploy">
          <p>
            Deploy an artifact to the set of remote repositories.
            <br/>
            Following files will be deployed to remote repository:
             <ol>
                <li>Artifact file</li>
                <li>MD5 checksum file of this artifact</li>
             </ol>         
          </p>
          <table>
            <tr>
              <th>Attribute Name</th><th>Description</th><th>Optional?</th>
            </tr>
            <tr>
              <td>artifact</td>
              <td>The path to the artifact file</td>
              <td>No</td>
            </tr>
            <tr>
              <td>type</td>
              <td>The type of the artifact 
                (like <i>jar</i> or <i>war</i>). Type is used for
                computing a detination path in repository.            
              </td>
              <td>No</td>
            </tr>
            <tr>
              <td>project</td>
              <td>
                 The project (POM) which produced artifact which will be deployed.
                 <br/>
                 POM contatins a bunch of settings (variables and context properties) 
                 which must be conulted in order to deploy artifact to repsoitories(s).
                 Those settings include:
                 <ol> 
                    <li>List of remote repositories where artifact will be 
deployed</li>
                    <li>artifactId, groupId, version</li>
                    <li>Individual settings of each repository</li>
                    <li>Proxy server settings</li>
                    <li>...</li>
                 </ol>
              </td>
              <td>NO</td>           
            </tr>
          </table>
        </subsection>
        
        <subsection name="artifact:deploy-snapshot">
          <p>
            Deploy a snapshot version of the artifact to a set of remote repositories.
            <br/>
            During deloyment following files are put to remote repository:
             <ul>
                <li>Timestamped Artifact file</li>
                <li>MD5 checksum file of timestamped artifact file</li>
                <li>Artifact file with version marked as <i>SNAPSHOT</i></li>
                <li>MD5 checksum file of this file</li>
                <li>${artifactId}-snapshot-version</li>
             </ul>
             For exaple for artifact with artifactId = <i>foo</i>
             the following files will be transfered to the remote repository:
             <ul>  
                <li>foo-20030620.124616.jar</li> 
                <li>foo-20030620.124616.jar.md5</li>
                <li>foo-SNAPSHOT.jar</li>
                <li>foo-SNAPSHOT.jar.md5</li>
                <li>foo-snapshot-version</li>          
             </ul>   
             
             File <i>foo-snapshot-version</i> 
             simply contains the version number (20030620.124616) 
             that the snapshot is linked with, 
             so that 
             <a 
href="http://maven.apache.org/reference/user-guide.html#Resolving%20SNAPSHOT%20Dependencies";>'convert-snapshots'</a>
               can correctly update dependencies in projects which will use this 
artifact. 
             <br/>
             <b>artifact:deploy-snapshot</b> tag uses the same set of attributes 
             as <a href="artifact:deloy">artifact:deploy</a> tag                      
          </p>
        </subsection>
        <subsection name="artifact:install">
          <p>
            Install an artifact in the local repository
            <br/>
            Following files will be copied to the local repository:
             <ol>
                <li>Artifact file</li>
                <li>MD5 checksum file of this artifact</li>
             </ol>         
          </p>
          <p>
            <i>Why I should use <b>artifact:install</b> when it is so easy
            just to copy a file inside my plugin?
            </i>
            <br/>
            There are few good reason for that:
             <ul>             
               <li>
                  What is simple now, not necesserly must stay simple in the future.
                  E.g. when Maven will run in client-server mode
                  information about repository content can be cached
                  and even some files from repository can cached in memory
                  (e.g. POMS). Using centralized "proxy" which copies
                  files to the repository can play importand role in this
                  process.               
               </li>
               <li>
                 It is as simple to use as ant:copy task, but does not require
                 usage of Ant.
               </li>
             </ul>
          </p>
          <table>
            <tr>
              <th>Attribute Name</th><th>Description</th><th>Optional?</th>
            </tr>
            <tr>
              <td>artifact</td>
              <td>The path to the artifact file</td>
              <td>No</td>
            </tr>
            <tr>
              <td>type</td>
              <td>The type of the artifact 
                (like <i>jar</i> or <i>war</i>). Type is used for
                computing a detination path in repository.            
              </td>
              <td>No</td>
            </tr>
            <tr>
              <td>project</td>
              <td>
                  Information  kept in the POM included following bits
                  used for controling:
                  <ul>
                    <li>artifactId, groupId, version</li>
                    <li>Location of the local repository</li>
                  </ul>
              </td>
              <td>NO</td>           
            </tr>
          </table>
        </subsection>
        
        <subsection name="artifact:install-snapshot">
          <p>
            Install a snapshot version of the artifact in the local repository
            <br/>
             Following files are copied to the local repository:
             <ul>
                <li>Timestamped Artifact file</li>
                <li>Artifact file with version marked as <i>SNAPSHOT</i></li>
             </ul>
             For exaple for artifact with artifactId foo
             following files will be transfered to local repository:
             <ul>  
                <li>foo-20030620.124616.jar</li> 
                <li>foo-SNAPSHOT.jar</li>      
             </ul>                         
             <br/>
             <b>artifact:install-snapshot</b> tag uses the same set of attributes 
             as <a href="#artifact:install">artifact:install</a> tag                   
   
          </p>
        </subsection>
      </section>
    </body>
  </document>
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <project name="Maven Artifact Plugin">
  
    <title>Maven Artifact Plugin</title>
  
    <body>
      <links>
        <item name="Maven" href="http://maven.apache.org/"/>
      </links>
      <menu name="Overview">
        <item name="Goals"                      href="/goals.html" />
        <item name="Properties"                 href="/properties.html" />
        <item name="Tags"                       href="/tags.html" />
        <item name="Examples"                   href="/examples.html" />
        <item name="Supported Protocols"        href="/protocols.html" />
        <item name="Security Considerations"    href="/security.html" />
        <item name="Key-based Authentification" href="/authentification.html" />
      </menu>
    </body>
  </project>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/authentification.xml
  
  Index: authentification.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
  
    <properties>
      <title>Maven Artifact Plugin Properties</title>
      <author email="[EMAIL PROTECTED]">Michal Maczka</author>
    </properties>
  
    <body>
      <section name="Key-based authentification">
      <p>
        In preparation
      </p>
      </section>  
    </body>
  </document>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <document>
  
    <properties>
      <title>Maven Artifact Plugin Properties</title>
      <author email="[EMAIL PROTECTED]">Michal Maczka</author>
    </properties>
  
    <body>
      <section name="Maven Artifact Plugin Settings">
        <table>
          <tr>
            <th>Property name</th>
            <th>Description</th>
            <th>Optional?</th>
          </tr>
          <tr>
            <td>maven.repo.list</td>
            <td>
              The list of comma separated names of 
              the repositories to which artifacts produced by 
              the project will be deployed. E.g.:
              <br/>
              <i>maven.repo.list=myrepo1,ibiblio</i>
              <br/>
              The names of all other properties are constructed using the
              entries present in this list. 
              Below the set of properties which can be used for
              configuration of deployment process to each of the repositories
              provided in the list. <i>x</i> in the names
              of those properties should be replaced by actual repository name
              (like <i>ibiblio</i>).
              In case of doubts see an <a href="example.html">example</a> 
            </td>
            <td>No</td>
          </tr>
          <tr>
            <td>maven.repo.x</td>
            <td>
               Specifies the URL of remote repository. The URL
               should contain the protocol name. 
               <br/>
               See the <a href="protocols.html">the list</a> of supported protocols.
               <br/>
               x corresponds to
               repository name defined using <i>maven.repo.list</i> property.          
   
            </td>
            <td>No</td>
          </tr>
          <tr>
            <td>maven.repo.x.directory</td>
            <td>
              The path at remote file system where artifacts will be put
            </td>
            <td>No</td>
          </tr>
          <tr>
            <td>maven.repo.x.username</td>
            <td>
               The user name which will be used to authetificated
               user if access to repository requires authentification.
            </td>
            <td>Yes</td>
          </tr>
          <tr>
            <td>maven.repo.x.password</td>
            <td>
              The password which will be used to authetificate
              user.
              <br/>
              If server/protocol supports authetification via
              both private/public keys and password,
              first will try to use keys for authentication 
              and if that doesn't work then 
              we fall back to using the username and password
            </td>
            <td>Yes</td>
          </tr>        
          <tr>
            <td>maven.repo.x.group</td>
            <td>
              The remote group (UNIX group) to which
              artifact will belong after it 
              will be deployed
            </td>
            <td>Yes</td>
          </tr>
          <tr>
            <td>maven.repo.x.privatekey</td>
            <td>
               The absoluth path to private key file.
               <br/>
               Thie is used only for when protocol
               supports authetification via private/public
               key pair.
            </td>
            <td>Yes</td>
          </tr>
          <tr>
            <td>maven.repo.x.passphrase</td>
            <td>
               The passphrase used to decrypt private key file
            </td>
            <td>Yes</td>
          </tr>
        </table>
      </section>
      <section name="Other properties used">
       <p>
         If you are behind firewall and need to use proxy server see
        <a 
href="http://maven.apache.org/reference/user-guide.html#Using%20Proxies";>following</a> 
   
        section from the <b>Maven User Guide</b> .     
       </p> 
      </section>  
    </body>
  </document>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
    <properties>
      <title>Changes</title>
      <author email="[EMAIL PROTECTED]">Jason van Zyl</author>
    </properties>
  
    <body>
      <release version="1.0" date="2002-08-04">
        <action dev="jvanzyl" type="add">
          Original release for Maven 1.0-beta8
        </action>
      </release>
    </body>
  </document>
  
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/security.xml
  
  Index: security.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Artifact Plug-in Examples</title>
      <author email="[EMAIL PROTECTED]">Tim Anderson</author>
    </properties>
  
    <body>
      <section name="Securiry consideration">
        <p>
        
  <source><![CDATA[
  > 
  > For the moment I have tested my API with username, user password 
  > kept in properties file. I think that such approach is not acceptable.
  > 
  > You can use command line to pass properties to maven: 
  > 
  > maven  war:deloy -Dmaven.repo.ibiblio.password = ******
  > 
  > 
  > This is already better ... but still not perfect.
  > 
  > I will try to implement/use(if I find one) simple class which will "Prompt" 
  > to type your password (eventually to enter other required parameters which
  > are missing)
  > 
  > regards
  > 
  > 
  > Michal
  
  I would avoid the command line passed password. It is much less secure
  on unix than the password kept in a file. Command line can be seen by
  simple ps commands, or e.g. linux systems store the in the /proc filesystem.
  It should be used only from command files.
  
  incze
  
  ]]></source>
        </p>
      </section>
    </body>
  </document>
  
  
  
  1.1                  maven/src/plugins-build/artifact/xdocs/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  stylesheets
  
  
  
  1.4       +8 -6      
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/HttpDeployer.java
  
  Index: HttpDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/HttpDeployer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HttpDeployer.java 25 Jun 2003 15:25:18 -0000      1.3
  +++ HttpDeployer.java 29 Jun 2003 11:57:39 -0000      1.4
  @@ -70,7 +70,7 @@
   import org.apache.commons.httpclient.UsernamePasswordCredentials;
   import org.apache.commons.httpclient.methods.PutMethod;
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
   
   /**
    * An HTTP deployer based the Commons HttpClient library.
  @@ -86,12 +86,14 @@
    */
   public class HttpDeployer extends AbstractDeployer
   {
  -
  +    /**Protocol understood by by this deployer*/
       public final static String PROTOCOL = "http://";;
  +    
  +    
       /**
        * Description of the Method
        */
  -    public void deploy(DeployRequest request) throws DeployException
  +    public void deploy(DeployRequest request) throws TransferFailedException
       {
           URL url = null;
           try
  @@ -104,7 +106,7 @@
   
           Credentials creds =
               new UsernamePasswordCredentials(
  -                request.getUser(),
  +                request.getUserName(),
                   request.getPassword());                
   
           //create a singular HttpClient object
  @@ -135,7 +137,7 @@
           }
           catch(FileNotFoundException io)
           {
  -          throw new DeployException("input file: '"+ request.getSrcFile() + " not 
found ");
  +          throw new TransferFailedException("input file: '"+ request.getSrcFile() + 
" not found ");
           }  
   
           //turn follow redirects off
  
  
  
  1.5       +31 -32    
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/FtpDeployer.java
  
  Index: FtpDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/FtpDeployer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FtpDeployer.java  25 Jun 2003 15:25:18 -0000      1.4
  +++ FtpDeployer.java  29 Jun 2003 11:57:39 -0000      1.5
  @@ -66,11 +66,7 @@
   import org.apache.commons.net.ftp.FTPConnectionClosedException;
   import org.apache.commons.net.ftp.FTPReply;
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  -
  -
  -
  -
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
   
   /**
    * An FTP deployer based on the FTPClient in the Commons Net package.
  @@ -86,35 +82,38 @@
    */
   public class FtpDeployer extends AbstractDeployer
   {
  -    
  +    /** Protocol understandable by this deployer*/
       public final static String PROTOCOL = "ftp://";;
  -            
  +
  +    
  +
       /**
  -     * Description of the Method
  +     * @see Deployer#deploy(DeployRequest)
        */
  -    public void deploy(DeployRequest request) throws DeployException
  +    public void deploy(DeployRequest request) throws TransferFailedException
       {
  -        String username = request.getUser();
  +        String username = request.getUserName();
           String password = request.getPassword();
  -        String host = request.getHost();      
  -        
  +        String host = request.getHost();
  +
           FTPClient ftp = new FTPClient();
  -                
  -        
  -        ftp.addProtocolCommandListener(
  -            new PrintCommandListener(new PrintWriter(System.out)));
   
  +        if (request.isDebugOn())
  +        {
  +            ftp.addProtocolCommandListener(
  +                new PrintCommandListener(new PrintWriter(System.out)));
  +        }
           try
  -        {                        
  +        {
               int reply;
  -            if ( request.getPort()!= DeployRequest.UNKNOWN_PORT)
  +            if (request.getPort() != DeployRequest.UNKNOWN_PORT)
               {
  -               ftp.connect(host, request.getPort());
  +                ftp.connect(host, request.getPort());
               }
               else
               {
                   ftp.connect(host);
  -            }               
  +            }
               System.out.println("Connected to " + host + ".");
   
               // After connection attempt, you should check the reply code to verify
  @@ -122,10 +121,10 @@
               reply = ftp.getReplyCode();
   
               if (FTPReply.isPositiveCompletion(reply) == false)
  -            {                
  +            {
                   ftp.disconnect();
                   System.err.println();
  -                throw new DeployException("FTP server refused connection.");
  +                throw new TransferFailedException("FTP server refused connection.");
               }
           }
           catch (IOException e)
  @@ -140,12 +139,12 @@
                   {
                       // do nothing
                   }
  -            }            
  -            throw new DeployException("Could not connect to server.");
  +            }
  +            throw new TransferFailedException("Could not connect to server.");
           }
   
           __main : try
  -        {            
  +        {
               if (ftp.login(username.trim(), password.trim()) == false)
               {
                   ftp.logout();
  @@ -162,15 +161,15 @@
               String workingDir = request.getDestDir();
               String filename = request.getDestFile();
               System.out.println("Working directory " + workingDir);
  -            System.out.println("Filename: " + filename);       
  +            System.out.println("Filename: " + filename);
               ftp.makeDirectory(workingDir);
  -            ftp.changeWorkingDirectory( workingDir);            
  -            ftp.storeFile(filename, new FileInputStream(request.getSrcFile()));     
       
  +            ftp.changeWorkingDirectory(workingDir);
  +            ftp.storeFile(filename, new FileInputStream(request.getSrcFile()));
               ftp.logout();
           }
           catch (FTPConnectionClosedException e)
  -        {            
  -            throw new DeployException("Server closed connection.");            
  +        {
  +            throw new TransferFailedException("Server closed connection.");
           }
           catch (IOException e)
           {
  @@ -227,5 +226,5 @@
               writer.flush();
           }
       }
  -    
  +
   }
  
  
  
  1.4       +16 -12    
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/SFtpDeployer.java
  
  Index: SFtpDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/SFtpDeployer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SFtpDeployer.java 25 Jun 2003 15:25:18 -0000      1.3
  +++ SFtpDeployer.java 29 Jun 2003 11:57:39 -0000      1.4
  @@ -58,7 +58,8 @@
   
   import org.apache.commons.lang.StringUtils;
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
  +import org.apache.maven.deploy.exceptions.WrongParameterException;
   
   import com.jcraft.jsch.ChannelSftp;
   import com.jcraft.jsch.JSchException;
  @@ -74,17 +75,20 @@
    */
   public class SFtpDeployer extends GenericSshDeployer
   {
  -
  +    /**Protocol understood by by this deployer*/
       public final static String PROTOCOL = "sftp://";;
  +
  +    /** SSH2 Chanel names used to communicate with the server*/
       private final static String SFTP_CHANNEL = "sftp";
  +    
  +    /** artibute of file used in SSH which denotes is given file is a directory*/
       private static final int S_IFDIR = 0x4000;
   
       /**
  -     * @see Deployer#project
  -     * 
  -     * @todo better way of guessing what king of proxy server is used
  +     * @see Deployer#deploy(DeployRequest)
        */
  -    public void deploy(DeployRequest request) throws DeployException
  +    public void deploy(DeployRequest request)
  +        throws TransferFailedException, WrongParameterException
       {
           Integer groupId = null;
           try
  @@ -96,7 +100,7 @@
           }
           catch (NumberFormatException e)
           {
  -            throw new DeployException("SFTP deployer: remote group should be an 
integer");
  +            throw new WrongParameterException("SFTP deployer: remote group should 
be an integer");
           }
   
           Session session = getSession(request);
  @@ -109,7 +113,7 @@
               // directory 
               String[] dirs = StringUtils.split(request.getDestDir(), "/");
               for (int i = 0; i < dirs.length; i++)
  -            {                
  +            {
                   try
                   {
                       SftpATTRS attrs = channel.stat(dirs[i]);
  @@ -120,7 +124,7 @@
                       }
                       else
                       {
  -                        throw new DeployException(
  +                        throw new WrongParameterException(
                               "Incorrect remote path:" + request.getDestDir());
                       }
                   }
  @@ -147,7 +151,7 @@
               String msg =
                   "Error occured while deploying to remote host:"
                       + request.getHost();
  -            throw new DeployException(msg, e);
  +            throw new TransferFailedException(msg, e);
           }
   
           catch (JSchException e)
  @@ -155,7 +159,7 @@
               String msg =
                   "Error occured while deploying to remote host:"
                       + request.getHost();
  -            throw new DeployException(msg, e);
  +            throw new TransferFailedException(msg, e);
           }
           finally
           {
  
  
  
  1.3       +12 -12    
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java
  
  Index: ScpDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/ScpDeployer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ScpDeployer.java  25 Jun 2003 15:25:18 -0000      1.2
  +++ ScpDeployer.java  29 Jun 2003 11:57:40 -0000      1.3
  @@ -62,7 +62,7 @@
   import java.io.OutputStream;
   
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
   
   import com.jcraft.jsch.ChannelExec;
   import com.jcraft.jsch.Session;
  @@ -75,17 +75,17 @@
    */
   public class ScpDeployer extends GenericSshDeployer
   {
  -
  +    /**Protocol understood by by this deployer*/
       public final static String PROTOCOL = "scp://";
   
  +    /** SSH2 Chanel names used to communicate with the server*/
       public final static String EXEC_CHANNEL = "exec";
   
       /**
  -     * @see Deployer#project
  -     * 
  -     * @todo better way of guessing what king of proxy server is used
  +     * @see Deployer#deploy(DeployRequest)
  +     *
        */
  -    public void deploy(DeployRequest request) throws DeployException
  +    public void deploy(DeployRequest request) throws TransferFailedException
       {
   
           Session session = getSession(request);
  @@ -116,10 +116,10 @@
       }
   
       /**
  -     * Execute simple command  
  +     * Execute <i>"simple"</i> remote command using exec channel  
        */
       private void executeSimpleCommand(Session session, String command)
  -        throws DeployException
  +        throws TransferFailedException
       {
   
           System.out.println("Executing command: " + command);
  @@ -134,7 +134,7 @@
           }
           catch (Exception e)
           {
  -            throw new DeployException(
  +            throw new TransferFailedException(
                   "Cannot execute remote command: " + command);
           }
           finally
  @@ -151,7 +151,7 @@
        * Code extracted from JSCH exaples
        */
       private void doCopy(Session session, DeployRequest request)
  -        throws DeployException
  +        throws TransferFailedException
       {
   
           try
  @@ -231,7 +231,7 @@
               String msg =
                   "Error occured while deploying to remote host:"
                       + request.getHost();
  -            throw new DeployException(msg,e);
  +            throw new TransferFailedException(msg,e);
           }
       }
   
  
  
  
  1.6       +13 -10    
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/FileDeployer.java
  
  Index: FileDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/FileDeployer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FileDeployer.java 25 Jun 2003 15:25:18 -0000      1.5
  +++ FileDeployer.java 29 Jun 2003 11:57:40 -0000      1.6
  @@ -61,9 +61,11 @@
   
   import org.apache.commons.io.FileUtils;
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
   
   /**
  + * Deployer which deploys to directory visible in local
  + * file system.
    * 
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
    * @version $Id$
  @@ -71,30 +73,31 @@
   public class FileDeployer implements Deployer
   {
   
  +    /** Protocol understandable by this deployer*/
       public final static String PROTOCOL = "file://";
   
       /**
        * @see org.apache.maven.fetch.fetchers.Fetcher#fetchUrl(java.lang.String, 
java.io.OutputStream)
        */
  -    public void deploy(DeployRequest request) throws DeployException
  +    public void deploy(DeployRequest request) throws TransferFailedException
       {
           try
           {
  -            File inputFile = new File(request.getSrcFile());
  +            File srcFile = new File(request.getSrcFile());
   
  -            File outputFile =
  +            File destFile =
                   new File(request.getHost(), request.getDestDir());
               
  -            if (! outputFile.exists())
  +            if (! destFile.exists())
               {
  -               outputFile.mkdirs();
  +               destFile.mkdirs();
               }
  -            outputFile = new File(  outputFile, request.getDestFile());             
                      
  -            FileUtils.copyFile(inputFile, outputFile);
  +            destFile = new File(  destFile, request.getDestFile());                 
                  
  +            FileUtils.copyFile(srcFile, destFile);
           }
           catch (IOException e)
           {
  -            throw new DeployException("Cannot copy file: " + e.getMessage());
  +            throw new TransferFailedException("Cannot copy file: " + 
e.getMessage());
           }
       }
   }
  
  
  
  1.2       +20 -5     
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/Deployer.java
  
  Index: Deployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/Deployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Deployer.java     17 Jun 2003 22:05:59 -0000      1.1
  +++ Deployer.java     29 Jun 2003 11:57:40 -0000      1.2
  @@ -1,7 +1,10 @@
   package org.apache.maven.deploy.deployers;
   
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.NotAuthorizedDeployException;
  +import org.apache.maven.deploy.exceptions.ProxyNotAuthorizedDeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
  +import org.apache.maven.deploy.exceptions.WrongParameterException;
   
   /* ====================================================================
    * The Apache Software License, Version 1.1
  @@ -61,6 +64,10 @@
   
   /**
    * Interface for all Maven deployers.
  + * 
  + * Deployer which uploads a file to remote host accordingly to paramters
  + * recieved in <i>deploy request</i>
  + 
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @version $Id$
  @@ -68,8 +75,16 @@
   public interface Deployer
   {
       /**
  -     * 
  -     * @param request
  +     * Perform an unppload of single file to remote host
  +     * @param request <code>DeployRequest</code> which should contatin all 
parameters
  +     * which are necessery to upload a file
  +     * to remote host.  
        */
  -    public void deploy(DeployRequest request) throws DeployException;
  +    public void deploy(DeployRequest request)
  +        throws
  +            TransferFailedException,
  +            NotAuthorizedDeployException,
  +            ProxyNotAuthorizedDeployException,
  +            TransferFailedException,
  +            WrongParameterException;
   }
  
  
  
  1.3       +54 -33    
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/GenericSshDeployer.java
  
  Index: GenericSshDeployer.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/deployers/GenericSshDeployer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenericSshDeployer.java   25 Jun 2003 15:25:18 -0000      1.2
  +++ GenericSshDeployer.java   29 Jun 2003 11:57:40 -0000      1.3
  @@ -59,7 +59,8 @@
   import java.io.File;
   
   import org.apache.maven.deploy.DeployRequest;
  -import org.apache.maven.deploy.exceptions.DeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
  +import org.apache.maven.deploy.exceptions.WrongParameterException;
   
   import com.jcraft.jsch.JSch;
   import com.jcraft.jsch.Proxy;
  @@ -69,36 +70,39 @@
   import com.jcraft.jsch.UserInfo;
   
   /**
  - * An ssh2 deployer that uses the JSch library and the JCE. 
  + * A base class for deployers using  protocols from SSH2 family  
  + * and JSch library for underlining implmenetation 
    * 
  - * This class deals with authetification stage of the process.
  + * This class deals with authentification stage of the process.
    * 
    * 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 of the user in question. NOTE: We are
  - * assuming the standard port of 22.
  + * to using the login and password
    * 
  - *
    * @version $Id$
    * @todo still have to account for differing setups for people deploying to
    *      their own sites and to the central repository.
  + * @todo improve exception handling
    */
   public abstract class GenericSshDeployer extends AbstractDeployer
   {
  -        
  +
  +    /** Default port used for SSH protocol */
       public final static int DEFAULT_SSH_PORT = 22;
  +
  +    /** Default port used by SOCKS5 proxy server */
       public final static int SOCKS5_PROXY_PORT = 1080;
  -    
   
       /**
        * @see Deployer#project
        * 
        * @todo better way of guessing what kind of proxy server is used
  -     *   by user
  +     *   by user. Jsch Supports among others SOCKS and HTTP proxies
        */
  -    public Session getSession(DeployRequest request) throws DeployException
  +    public Session getSession(final DeployRequest request)
  +        throws TransferFailedException
       {
  -        
  +
           try
           {
               JSch jsch = new JSch();
  @@ -108,8 +112,38 @@
               {
                   port = DEFAULT_SSH_PORT;
               }
  +            System.out.println("host: '"+  request.getHost() + "'");
               String host = request.getHost();
  -            Session session = jsch.getSession(request.getUser(), host, port);
  +            Session session =
  +                jsch.getSession(request.getUserName(), host, port);
  +                                
  +            // Look for the private key and use it if available.
  +            if (request.getPrivateKey() != null)
  +            {
  +                File privateKey = new File(request.getPrivateKey());
  +
  +                if (privateKey.exists())
  +                {
  +                    if (request.getPassphrase() == null)
  +                    {
  +                        String msg =
  +                            "Private key provided "
  +                                + "without passpharse for repo: "
  +                                + request.getRepositoryAlias();
  +                        throw new WrongParameterException(msg);
  +                    }
  +
  +                    System.out.println("Using private key: " + privateKey);
  +                    jsch.addIdentity(
  +                        privateKey.getAbsolutePath(),
  +                        request.getPassphrase());
  +                }
  +                else
  +                {
  +                    String msg = "Private key: " + privateKey + " not found ";
  +                    throw new WrongParameterException(msg);
  +                }
  +            }
   
               String proxyHost = request.getProxyHost();
   
  @@ -117,6 +151,7 @@
               {
                   Proxy proxy = null;
                   int proxyPort = request.getProxyPort();
  +                // HACK:
                   //if port == 1080 we will use SOCKS5 Proxy
                   // otherwise will use HTTP Proxy
   
  @@ -124,33 +159,19 @@
                   {
                       proxy = new ProxySOCKS5(proxyHost);
                       ((ProxySOCKS5) proxy).setUserPasswd(
  -                        request.getProxyUser(),
  -                        request.getProxyPass());
  +                        request.getProxyUserName(),
  +                        request.getProxyPassword());
                   }
                   else
                   {
                       proxy = new ProxyHTTP(proxyHost, proxyPort);
                       ((ProxyHTTP) proxy).setUserPasswd(
  -                        request.getProxyUser(),
  -                        request.getProxyPass());
  +                        request.getProxyUserName(),
  +                        request.getProxyPassword());
                   }
                   proxy.connect(session, host, port);
   
  -            }
  -
  -            // Look for the private key and use it if available.
  -            if (request.getPrivateKey() != null)
  -            {
  -                File privateKey = new File(request.getPrivateKey());
  -
  -                if (privateKey.exists())
  -                {
  -                    System.out.println("Using private key: " + privateKey);
  -                    jsch.addIdentity(
  -                        privateKey.getAbsolutePath(),
  -                        request.getPassphrase());
  -                }
  -            }
  +           }
               // username and password will be given via UserInfo interface.
               UserInfo ui = new MavenUserInfo(request);
               session.setUserInfo(ui);
  @@ -161,7 +182,7 @@
           catch (Exception e)
           {
               e.printStackTrace();
  -            throw new DeployException(
  +            throw new TransferFailedException(
                   "Cannot connect. Reason: " + e.getMessage(),
                   e);
           }
  
  
  
  1.5       +138 -47   
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/DeployRequest.java
  
  Index: DeployRequest.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/DeployRequest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeployRequest.java        25 Jun 2003 15:25:19 -0000      1.4
  +++ DeployRequest.java        29 Jun 2003 11:57:40 -0000      1.5
  @@ -18,7 +18,7 @@
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
  - * 3. The end-user documentation included with the redistribution,
  + * 3. The end-userName 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/)."
  @@ -57,6 +57,9 @@
    */
   
   /**
  + * Holder of the variables which are used by deployers for
  + * esatblishing connection to remote hosts and to 
  + * deploy the file to correct location in remote file system
    * 
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
    * @version $Id$
  @@ -64,35 +67,62 @@
   public class DeployRequest
   {
   
  +    /** Used to mark */
       public final static int UNKNOWN_PORT = -1;
  +
       public final static String HEADER_USER_AGENT =
           "Maven-Deploy-" + DeployTool.VERSION;
   
  +    /** The nickname (alias) of the repository*/
       private String repositoryAlias;
  +
  +    /** URL of the remote host*/
       private String url;
  +    
  +    /** Port of remote host */
       private int port = UNKNOWN_PORT;
  +    
  +    /** The directory where artifact will be placed */
       private String destDir;
  +    
  +    /** The filename of the artifact */
       private String destFile;
  +    
  +    /** The artifact file in local file system */
       private String srcFile;
   
  -    /*
  -     * Resource access user / password /group
  -     */
  -    private String user;
  +    /** The login name of the user in @ remote host*/
  +    private String userName;
  +    
  +    /** Password */
       private String password;
  +    
  +    /** Remote group name */
       private String group;
  +    
  +    /** The passpharse of the user's private key file */
       private String passphrase;
  +    
  +    /** The absoluth path to private key file */
       private String privateKey;
   
  -    /*
  -     * Proxy server settings.  If proxy host is not null, settings will be used. 
  -     */
  +    /**  Proxy Server host*/     
       private String proxyHost = null;
  -    private String proxyUser = null;
  -    private String proxyPass = null;
  +    
  +    /** the login name of the user @ Proxy Server host*/
  +    private String proxyUserName = null;
  +    
  +    /** the password user @ Proxy Server host*/
  +    private String proxyPassword = null;
  +    
  +    /** Proxy server port */
       private int proxyPort = UNKNOWN_PORT;
   
  +    /** Indicates if debug mode should be used*/ 
  +    private boolean debugOn = false;
  +
       /**
  +     * Set the alias of the repository
        * @param repositoryAlias
        */
       public void setRepositoryAlias(String repositoryAlias)
  @@ -101,7 +131,8 @@
       }
   
       /**
  -     * @return
  +     * Get the port of the host 
  +     * @return the port of the remote host where repository resides.
        */
       public int getPort()
       {
  @@ -109,6 +140,7 @@
       }
   
       /**
  +     * Set the port of the remote host
        * @param port
        */
       public void setPort(int port)
  @@ -117,7 +149,12 @@
       }
   
       /**
  -     * @return
  +     * Get the passphrase of the private key file.
  +     * Passphrase is used only when host/protocol supports
  +     * authetification via exchange of private/public keys
  +     * and private key was provided.
  +     * 
  +     * @return the passphrase of the private key file
        */
       public String getPassphrase()
       {
  @@ -125,7 +162,8 @@
       }
   
       /**
  -     * @param passphrase
  +     * Set the passphrase of the private key file
  +     * @param passphrase the passphrase of the private key file
        */
       public void setPassphrase(String passphrase)
       {
  @@ -133,7 +171,8 @@
       }
   
       /**
  -     * @return
  +     * Get the absoluth path to the private key
  +     * @return the path to private key
        */
       public String getPrivateKey()
       {
  @@ -141,7 +180,8 @@
       }
   
       /**
  -     * @param privateKey
  +     * Set the aboluth path to private key
  +     * @param privateKey The path to private key in local file system
        */
       public void setPrivateKey(String privateKey)
       {
  @@ -149,7 +189,10 @@
       }
   
       /**
  -     * @return
  +     * Get the remote group to which will belong to
  +     * after deployemnt. Not all protolcols support
  +     * allow to change the group of the artifact
  +     * @return remote group
        */
       public String getGroup()
       {
  @@ -157,7 +200,9 @@
       }
   
       /**
  -     * @param group
  +     * Set the remote group for artifact which is deployed
  +     * @param group  The remote group to which 
  +     *                artifact which is deployed will belong
        */
       public void setGroup(String group)
       {
  @@ -173,7 +218,8 @@
       }
   
       /**
  -     * @return
  +     * Get aboluth path to local files = artifact
  +     * @return Path to artifact file
        */
       public String getSrcFile()
       {
  @@ -181,6 +227,7 @@
       }
   
       /**
  +     * Set the aboluthe path to artifact file
        * @param srcFile
        */
       public void setSrcFile(String inputFile)
  @@ -189,7 +236,10 @@
       }
   
       /**
  -     * @return
  +     * Get destination directory in remote file system for
  +     * the artifact
  +     * 
  +     * @return destination dir for artifact
        */
       public String getDestDir()
       {
  @@ -197,7 +247,9 @@
       }
   
       /**
  -     * @param destDir
  +     * Set destinatin directory in remote file system
  +     * 
  +     * @param destDir the remote path for the artifact 
        */
       public void setDestDir(String outputDir)
       {
  @@ -205,6 +257,7 @@
       }
   
       /**
  +     * Get destination file name
        * @return
        */
       public String getDestFile()
  @@ -213,6 +266,7 @@
       }
   
       /**
  +     * Set destination file name
        * @param destFile
        */
       public void setDestFile(String outputFile)
  @@ -221,7 +275,9 @@
       }
   
       /**
  -     * @return
  +     * Get the password to be used when user will be authetificated
  +     * while connection to remote host is established
  +     * @return the password of user 
        */
       public String getPassword()
       {
  @@ -229,6 +285,8 @@
       }
   
       /**
  +     * 
  +     * 
        * @param password
        */
       public void setPassword(String pass)
  @@ -237,7 +295,8 @@
       }
   
       /**
  -     * @return
  +     * Returhn proxy server host name
  +     * @return proxy server host name
        */
       public String getProxyHost()
       {
  @@ -245,6 +304,7 @@
       }
   
       /**
  +     * Set proxy host name
        * @param proxyHost
        */
       public void setProxyHost(String proxyHost)
  @@ -253,23 +313,26 @@
       }
   
       /**
  -     * @return
  +     * Get user's password used to login to proxy server 
  +     * @return the user's password at proxy host 
        */
  -    public String getProxyPass()
  +    public String getProxyPassword()
       {
  -        return proxyPass;
  +        return proxyPassword;
       }
   
       /**
  -     * @param proxyPass
  +     * Set the proxy server password
  +     * @param proxyPassword teh epassword to use to login to a proxy server
        */
  -    public void setProxyPass(String proxyPass)
  +    public void setProxyPassword(String proxyPass)
       {
  -        this.proxyPass = proxyPass;
  +        this.proxyPassword = proxyPass;
       }
   
       /**
  -     * @return
  +     * Get the proxy port
  +     * @return Poroxy server port
        */
       public int getProxyPort()
       {
  @@ -277,6 +340,7 @@
       }
   
       /**
  +     * Set the proxy port
        * @param proxyPort
        */
       public void setProxyPort(int proxyPort)
  @@ -285,23 +349,27 @@
       }
   
       /**
  +     * 
  +     * Get the proxy user name
        * @return
        */
  -    public String getProxyUser()
  +    public String getProxyUserName()
       {
  -        return proxyUser;
  +        return proxyUserName;
       }
   
       /**
  -     * @param proxyUser
  +     * Set the proxy user name
  +     * @param proxyUserName the proxy user name
        */
  -    public void setProxyUser(String proxyUser)
  +    public void setProxyUserName(String proxyUser)
       {
  -        this.proxyUser = proxyUser;
  +        this.proxyUserName = proxyUser;
       }
   
       /**
  -     * @return
  +     * Get url of remote host
  +     * @return URL (with protocol) of remote host
        */
       public String getUrl()
       {
  @@ -309,7 +377,8 @@
       }
   
       /**
  -     * @param url
  +     * Set url of remote host
  +     * @param url url of remote host
        */
       public void setUrl(String url)
       {
  @@ -317,24 +386,26 @@
       }
   
       /**
  -     * @return
  +     * Get user login name at remote host 
  +     * @return user name at remote host
        */
  -    public String getUser()
  +    public String getUserName()
       {
  -        return user;
  +        return userName;
       }
   
       /**
  -     * @param user
  +     * Set user name at remote host
  +     * @param userName
        */
  -    public void setUser(String user)
  +    public void setUserName(String user)
       {
  -        this.user = user;
  +        this.userName = user;
       }
   
       /**
  -     * Cut of protocol from the URL
  -     * @return
  +     * Return the host name (Cuts of protocol from the URL)
  +     * @return The host name 
        */
       public String getHost()
       {
  @@ -342,16 +413,36 @@
           {
               return "localhost";
           }
  -        return url.substring(url.indexOf("://") + 3);
  +        return url.substring(url.indexOf("://") + 3).trim();
       }
   
       /**
  -     * @return
  +     * Get the name of the repository to which deploy attempt will be made  
  +     * 
  +     * @return the name (nickname, alias) of the repository 
        */
       public String getRepositoryAlias()
       {
   
           return repositoryAlias;
  +    }
  +
  +    /**
  +     * Get Debug mode
  +     * @return the debug mode
  +     */
  +    public boolean isDebugOn()
  +    {
  +        return debugOn;
  +    }
  +
  +    /**
  +     * Set deplyer in debug mode - more messages will be wriiten 
  +     * @param debugOn
  +     */
  +    public void setDebugOn(boolean debugOn)
  +    {
  +        this.debugOn = debugOn;
       }
   
   }
  
  
  
  1.5       +25 -8     
maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/DeployTool.java
  
  Index: DeployTool.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/plugins-build/artifact/src/main/org/apache/maven/deploy/DeployTool.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DeployTool.java   25 Jun 2003 12:33:11 -0000      1.4
  +++ DeployTool.java   29 Jun 2003 11:57:40 -0000      1.5
  @@ -62,27 +62,44 @@
   import org.apache.maven.deploy.deployers.HttpDeployer;
   import org.apache.maven.deploy.deployers.SFtpDeployer;
   import org.apache.maven.deploy.deployers.ScpDeployer;
  -import org.apache.maven.deploy.exceptions.DeployException;
  -import org.apache.maven.deploy.exceptions.UnsupportedProtocolDeployException;
  +import org.apache.maven.deploy.exceptions.NotAuthorizedDeployException;
  +import org.apache.maven.deploy.exceptions.ProxyNotAuthorizedDeployException;
  +import org.apache.maven.deploy.exceptions.TransferFailedException;
  +import org.apache.maven.deploy.exceptions.UnsupportedProtocolException;
  +import org.apache.maven.deploy.exceptions.WrongParameterException;
   
   /**
  - * 
  + * Delegates 
    * @author <a href="[EMAIL PROTECTED]">Michal Maczka</a> 
    * @version $Id$
    */
   public class DeployTool
   {
  +    /** Current Version **/
       public static final String VERSION = "1.0-dev";
   
  -    public void performUpload(DeployRequest request) throws DeployException
  +    /**
  +     * Upload (deploy) artifact to remote repository using
  +     * paramerters kepts in <code>DeployReequest</code> 
  +     * @param request The settings
  +     * @throws DeployException When operation fails
  +     */
  +    public void performUpload(DeployRequest request)
  +        throws
  +            TransferFailedException,
  +            NotAuthorizedDeployException,
  +            ProxyNotAuthorizedDeployException,
  +            TransferFailedException,
  +            WrongParameterException,
  +            UnsupportedProtocolException
       {
           String url = request.getUrl();
           Deployer deployer = null;
   
           if (url == null || url.length() == 1)
           {
  -            throw new DeployException(
  -                "No URL provided for repsoitory: "
  +            throw new WrongParameterException(
  +                "No URL provided for repository: "
                       + request.getRepositoryAlias());
           }
           if (url.startsWith(HttpDeployer.PROTOCOL))
  @@ -107,7 +124,7 @@
           }
           if (deployer == null)
           {
  -            throw new UnsupportedProtocolDeployException(url);
  +            throw new UnsupportedProtocolException(url);
           }
           deployer.deploy(request);
   
  
  
  

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

Reply via email to