code: public void execute() throws MojoExecutionException, MojoFailureException
     {
        if (file == null)
           throw new MojoFailureException("File not defined");
  
        if (!file.exists())
           throw new MojoFailureException("File doesn't exists: " + file);
  
        FileInputStream fis = null;
        try
        {
           Boolean result = null;
           if (isLocal())
           {
              Object value = executeCommand("local-deploy", new Serializable[] {file.toURI().toURL()});
  
              if (value instanceof Boolean)
              {
                 result = (Boolean)value;
              }
              else
              {
                 throw (Throwable)value;
              }
           }
           else
           {
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
  
              fis = new FileInputStream(file);
              int i = fis.read();
              while (i != -1)
              {
                 baos.write(i);
                 i = fis.read();
              }
  
              byte[] bytes = baos.toByteArray();
  
              Object value = executeCommand("remote-deploy", new Serializable[] {file.getName(), bytes});
  
              if (value instanceof Boolean)
              {
                 result = (Boolean)value;
              }
              else
              {
                 throw (Throwable)value;
              }
           }
  
           if (result.booleanValue())
           {
              getLog().info("Deployed: " + file.getName());
           }
           else
           {
              getLog().info(file.getName() + " wasn't deployed");
           }
        }
        catch (Throwable t)
        {
           throw new MojoFailureException("Unable to deploy to " + getHost() + ":" + getPort() +
                                          " (" + t.getMessage() + ")", t);
        }
        finally
        {
           if (fis != null)
           {
              try
              {
                 fis.close();
              }
              catch (IOException ioe)
              {
                 // Ignore
              }
           }
        }
     }
docs: {@inheritDoc}